Skip to content

[3.0] Theme split (wave 2, part 2) — Move the button values into variables.css - #9351

Merged
Sesquipedalian merged 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/theme-tokens-buttons
Aug 3, 2026
Merged

[3.0] Theme split (wave 2, part 2) — Move the button values into variables.css#9351
Sesquipedalian merged 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/theme-tokens-buttons

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part of the #7933 split, wave 2 part 2. Stacked on #9350 — that one adds variables.css; this one adds the next group of tokens to it. Until #9350 lands, this PR's diff shows both commits. Nothing else depends on the order.

The .button family. index.css styles buttons, the quickbuttons and the inline moderation checkbox through the same set of rules, so they move together:

Rule Tokens
.button, .quickbuttons > li > a, .inline_mod_check --button-color, --button-font-size, --button-text-transform, --button-cursor, --button-border-*, --button-box-shadow
.button:hover, .button:focus, .quickbuttons … --button-border-color_hover, --button-box-shadow_hover
.button:hover, .button:focus --button-color_hover
.button.active --button-bg_active, --button-color_active, --button-font-weight_active, --button-border-color_active, --button-text-shadow_active
.button.active:hover, .button.active:focus --button-color_active_hover, --button-box-shadow_active

Names again match the ones #7933 uses, and every value is the one the rule already had. Nothing changes on screen.

Two values left hard-coded on purpose

  • .pagesection .button { color: #346 } is the body link colour, not a button colour. It happens to equal --body-link-color, and pointing it there would be a guess about intent rather than a rename.
  • color: #222 in the shared hover rule only ever reaches the quickbuttons: the very next rule overrides it for .button. There is no honest name for it in this vocabulary yet.

Both are better decided by whoever changes the palette than by a mechanical substitution.

Testing

Fresh install on MySQL, Docker environment. Two passes:

  1. Each token resolves to the literal it replaced. Read all nineteen back from :root in the browser and compared against the strings they were lifted from — no mismatches. Since the substitutions are textually 1:1, that alone settles the normal case and the states that cannot be simulated.
  2. Computed styles before and after for eleven button variants — plain, active, quickbutton, inline mod check, first and last in a .buttonrow, inside a .cat_bar, .smalltext, and the three of those that can hold focus — across twenty properties including all four border colours, the shadow and the text shadow. 220 comparisons, no differences.

Error log clean. The unit suite does not reach CSS, so there is no test to add here.

Issues References (Fixes|Related|Closes)

Related to #7933, #9350

Theme::loadCss() has been asking for variables.css since 3.0 Alpha, at
order_pos -2 so it lands ahead of index.css, but the default theme never
shipped the file. The request is quietly dropped, so nothing breaks and
nothing happens either. This adds it.

The first group of tokens covers what index.css sets before it gets to any
particular part of the forum: the html and body backgrounds, the body font
and colour, the selection colours, form controls in their normal, hover,
focus and disabled states, fieldsets and their legends, strong, headings,
and the horizontal rule.

Every value is the one that rule already had, so this changes no pixels.
That is the point: it puts the vocabulary in place, with the names the
new theme uses, so the parts that follow can convert their own section of
index.css without also arguing about what the value ought to be. Changing
what the forum looks like is a separate job from giving its values names.

Verified by comparing computed styles across eight pages - board index,
board, topic, posting form, search, profile, admin and help - for the
eighteen selectors these rules reach and the fourteen properties they set.
1316 comparisons, no differences.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Second group of tokens: the .button family, which the quickbuttons and the
inline moderation checkbox share the same rules with. Normal, hover, focus
and active states, plus the border, radius, shadow, cursor, font size, text
transform and the text shadow the active button carries.

As with the first group, every value is the one the rule already had, so
nothing changes on screen. The two hard-coded values left in these rules are
deliberate: .pagesection .button uses the body link colour rather than a
button colour, and the SimpleMachines#222 in the shared hover rule only ever reaches the
quickbuttons, because the very next rule overrides it for .button. Neither
has an honest name in this vocabulary yet.

Verified two ways. Each of the nineteen tokens resolves to exactly the
literal it replaced, read back from :root in the browser. Then computed
styles for eleven button variants - plain, active, quickbutton, inline mod
check, first and last in a buttonrow, inside a cat_bar, smalltext, and the
three of those that can hold focus - across twenty properties. 220
comparisons, no differences.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast

Copy link
Copy Markdown
Collaborator Author

There is now an alternative for anyone who would rather take wave 2 as a single unit: #9358 carries all eight parts, merged and verified together against plain release-3.0.

It is an either/or, not an addition — merging #9358 means closing this one, and vice versa. Whichever suits the review better.

@Sesquipedalian
Sesquipedalian merged commit bdd097d into SimpleMachines:release-3.0 Aug 3, 2026
4 checks passed
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants