Skip to content

[3.0] Theme split (wave 6, part 1) — give the profile its own stylesheet - #9547

Merged
jdarwood007 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-profile-css
Aug 24, 2026
Merged

[3.0] Theme split (wave 6, part 1) — give the profile its own stylesheet#9547
jdarwood007 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-profile-css

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

index.css carried a "profile section" of about three hundred lines that every page in the forum downloaded. This moves the part of it that only the profile draws into a profile.css, loaded from SMF\Actions\Profile\Main beside the profile.js it already loads there.

Only part of it moved, and which part is the whole question. That section is not profile-scoped despite its heading:

  • the post list it holds is the same one the moderation centre, personal messages, recent posts and search all render (.list_posts, .counter, .topic_details);
  • the board picker is shared with search (.boardslist, #advanced_panel);
  • #paid_subscription, #pick_theme and #theme_settings belong to the admin centre;
  • #creator is also emitted by the password reminder;
  • and it opens with a bare dl { overflow: auto; } — a global rule that happens to sit under the heading.

Moving the section wholesale would have unstyled all of those.

How the line was drawn

Every selector was resolved against the templates that actually emit it — matching class="…" and id="…" attributes rather than bare words, because a plain grep for bar, post or time matches half the theme. A rule moved only when the leftmost element of every one of its branches is something no template but the profile emits, since anything to the right of that is already scoped by it.

35 rules moved on that test; 30 stayed.

Two rules went out entirely rather than moving: .sizefix and .topic .mod_icons name classes that nothing in Themes/ or Sources/ emits at all — not in a template, not in PHP, not in the scripts.

Verification

Computed colours, box metrics, display, float, margins, padding, font size and text alignment of every element on twenty-two pages, before and after — all eleven profile areas, the five pages that share those selectors, the two admin pages that own the blocks left behind, the reminder, the memberlist, the stats and the board index:

baseline records: 7260
after    records: 7260
differences:         0

One apparent difference turned out to be a measurement artifact and is worth recording: a stats-page bar read 254.232px in one capture and 0px in the other. Both captures had the same inline width: 100%, sampling the page twice on one branch gives 254.232px both times, the two .generic_bar rules that moved are both scoped under .activity_stats, the unscoped ones stayed in index.css, and the stats page does not load profile.css at all — so there is no path by which this change could reach it.

Part 1 of wave 6 of the #7933 split. It is the prerequisite the rest of the profile work needs: the template changes in that area reference rules that have to exist in a file of their own first.

Issues References (Fixes|Related|Closes)

Related #7933

index.css carried a "profile section" of about three hundred lines that every
page in the forum downloaded. This moves the part of it that only the profile
draws into a profile.css, loaded from SMF\Actions\Profile\Main beside the
profile.js it already loads there.

Only part of it moved, and which part is the whole question. That section is not
profile-scoped despite its heading: the post list it holds is the same one the
moderation centre, personal messages, recent posts and search all render, the
board picker is shared with search, and the paid subscription, theme picker and
theme settings blocks belong to the admin centre. It also opens with a bare
`dl { overflow: auto; }`, which is a global rule that happens to sit under the
heading. Moving the section wholesale would have unstyled all of those.

So every selector was resolved against the templates that actually emit it,
matching class and id attributes rather than bare words, and a rule moved only
when the leftmost element of every one of its branches is something no template
but the profile emits. Thirty-five rules moved on that test and thirty stayed.

Two rules went out entirely rather than moving: .sizefix and .topic .mod_icons
name classes that nothing in Themes/ or Sources/ emits at all.

Verified against a running forum: the computed colours, box metrics, display,
float, margins, padding, font size and alignment of every element on
twenty-two pages - all eleven profile areas, plus the five that share those
selectors, the two admin pages that own the blocks left behind, the reminder,
the memberlist, the stats and the board index - before and after. 7260
elements, no differences.

Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Comment thread Themes/default/css/index.css
Comment thread Themes/default/css/index.css
@jdarwood007
jdarwood007 merged commit a54ffb0 into SimpleMachines:release-3.0 Aug 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants