[3.0] Theme split (wave 5, part 3) — let the colour mode reach the post editor - #9498
Merged
jdarwood007 merged 2 commits intoAug 23, 2026
Merged
Conversation
Closed
Member
|
Can you rebase this, so I can figure out what I need to check and test? |
The editor's own stylesheet was never tokenised, so with dark mode on, the toolbar stayed a light grey island in the middle of a dark page. This gives its twenty colours tokens and a dark value each. One of them is not a colour. Every toolbar icon is cut from a single raster sprite, editor_sprite.png, so none of them can be recoloured the way an icon font or an SVG could, and in dark mode the near-black line art all but disappeared. A filter is the only lever a colour mode has over a raster, so the sprite gets one: `none` here, and an inversion in dark mode. The sprite is mixed - most icons are line art but a few carry their own colour, the YouTube mark among them - so the inversion is paired with a hue rotation, which puts the coloured ones back roughly where they started while the greys, having no hue to rotate, stay inverted. Only the chrome is in scope. The surface you type on is an iframe with its own document, and Editor.php hands it jquery.sceditor.default.css as its single stylesheet. No token is in scope inside that document, so tokenising that file would leave every var() unresolved and break the light theme as well; feeding the iframe the tokens is a change to how the editor is given its stylesheets and belongs on its own. Worth knowing that the surface is only shown to members who have turned the rich editor on - rich_active needs the wysiwyg_default option, which is off by default - so what everybody sees first is the source view, an ordinary textarea on the page itself, which already follows the mode. Light mode is unchanged: the computed colours of every element over twelve pages, on this branch and its parent, are identical. Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
The first pass matched `border`, `border-*-color` and the usual paint properties, which left four behind: the grip's `border-top`, the toolbar group's `border-bottom`, and the `fill` on the SVG icon variant and its disabled state. All four are light-theme values, so in dark mode the toolbar group kept a pale hairline under it. jquery.sceditor.css now has no literal colour left. Light mode is unchanged, checked the same way as the first pass and with `fill` added to the properties recorded. Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
albertlast
force-pushed
the
3.0/theme-editor-tokens
branch
from
August 23, 2026 19:41
30e9d07 to
0ae132e
Compare
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
With dark mode on, the post editor stayed a light grey island in the middle of a dark page — its stylesheet had never been tokenised, so nothing could reach it. This gives
jquery.sceditor.csstokens for all twenty-four of its colours and a dark value for each. It now has no literal colour left.One of them is not a colour
Every toolbar icon is cut from a single raster sprite,
images/icons/editor_sprite.png, so none of them can be recoloured the way an icon font or an SVG could — and in dark mode the near-black line art all but disappeared.A filter is the only lever a colour mode has over a raster, so the sprite gets one:
--editor-icon-filter,nonehere and an inversion in dark mode. The sprite is mixed — most icons are line art, but a few carry their own colour, the YouTube mark among them — so the inversion is paired with a hue rotation. The greys have no hue to rotate and simply invert; the coloured ones come back roughly where they started.Keeping it as a token is what lets
dark.cssstay what it claims to be: a file that overrides tokens and restates no rules.Only the chrome is in scope
The surface you actually type on is an iframe with its own document, and
Editor.php:846hands itjquery.sceditor.default.cssas its single stylesheet. No token is in scope inside that document, so tokenising that file would leave everyvar()unresolved and break the light theme too. Feeding the iframe the tokens is a change to how the editor is given its stylesheets, and belongs on its own.Worth knowing how much that leaves: the rich surface is only shown to members who have turned it on —
rich_activeneeds thewysiwyg_defaultoption, which is off by default — so what everybody sees first is the source view, an ordinarytextareaon the page itself, which already follows the mode correctly.Verification
Light mode is unchanged. Computed
color,background-color,background-image, all four border colours,box-shadow,outline-color,text-shadow,filterandfillfor every element over six pages, on this branch and on its parent, captured back to back so forum state could not drift:(Done twice — once for the first twenty tokens, once for the four a property-name regex had missed.)
Stacked on #9497 (wave 5, part 2, dark mode), which is itself stacked on #9496 (part 1). Without part 2 there is no dark mode for these tokens to have a second value in.
Part 3 of wave 5 of the #7933 split.
Issues References (Fixes|Related|Closes)
Related #7933