[3.0] Theme split (wave 6, part 1) — give the profile its own stylesheet - #9547
Merged
jdarwood007 merged 1 commit intoAug 24, 2026
Merged
Conversation
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>
This was referenced Aug 23, 2026
Closed
jdarwood007
reviewed
Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
index.csscarried 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 aprofile.css, loaded fromSMF\Actions\Profile\Mainbeside theprofile.jsit already loads there.Only part of it moved, and which part is the whole question. That section is not profile-scoped despite its heading:
.list_posts,.counter,.topic_details);.boardslist,#advanced_panel);#paid_subscription,#pick_themeand#theme_settingsbelong to the admin centre;#creatoris also emitted by the password reminder;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="…"andid="…"attributes rather than bare words, because a plain grep forbar,postortimematches 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:
.sizefixand.topic .mod_iconsname classes that nothing inThemes/orSources/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:One apparent difference turned out to be a measurement artifact and is worth recording: a stats-page bar read
254.232pxin one capture and0pxin the other. Both captures had the same inlinewidth: 100%, sampling the page twice on one branch gives254.232pxboth times, the two.generic_barrules that moved are both scoped under.activity_stats, the unscoped ones stayed inindex.css, and the stats page does not loadprofile.cssat 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