Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +7.51 kB (+0.09%) Total Size: 8.73 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. returns focus to the item's Options after adding a submenu link in
|
07a2661 to
4bb53ec
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
One warning about the video in the PR description — the But regardless, I do definitely perceive the improvement here in the "perception parity" between light and dark scales 🎉 |
|
This is a nice PR. It deserves more poring over than it might seem to need. For that reason, I wonder if it can wait until @jameskoster has a time to look? |
|
Sure, let's wait for @jameskoster . It will be a nice way for him to dive back into DS / theming Although I still reccomend y'all take this PR up for a spin and try out Storybook and Editor, to get a first intuiton of whether this overall feels good, and if there any obvious regressions. |
06682eb to
cbf1909
Compare
5765f76 to
f3d4a2a
Compare
Rebase the foreground, surface and stroke solvers onto trunk's primary contrast and background saturation changes. Keep the dark fill steps used by Switch and regenerate the theme tokens and admin color schemes.
Near black or white, sRGB has little room for chroma, so placing accent FGS4 at the neutral body-text contrast washed brand and status text out on dark and tinted surfaces. Stop FGS4 short of its preferred contrast when it would keep less than 80% of the highest chroma available above its minimum. Neutral paths stay below the chroma minimum, so gray text keeps the preferred contrast. WCAG floors and the weak-to-normal gap still apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chroma along one hue rises to a single cusp, so five samples and eight refinement steps find the same resting brand colors. This cuts the cost of the chroma-retention search from about 7.4 ms to 4.7 ms per theme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1dccd67 to
83e58fe
Compare
Fixes #77153. Follow-up to #82037. Alternative to #81537.
What?
Generate more evenly spaced color ramps across light, dark, and tinted themes. Body text and resting controls use the fourth foreground step. A new fifth step gives headings, overlay titles, and active controls stronger emphasis. In the default light theme, headings use
#141414and body text uses#464646. Brand and status text keep more of their color on dark and tinted surfaces.Why?
Equal lightness increments can look uneven. When body text and headings share the strongest foreground, there is little room to distinguish a heading or an active control from the surrounding text.
How?
The generator uses OKLr lightness for surfaces, perceptual color differences for strokes, and APCA for foreground spacing. It checks the configured WCAG floors against the final sRGB colors. The neutral strong-content token maps to the new step and is checked against all three neutral surfaces. Text heading variants, static editor and panel headings, and overlay titles use it. The WidgetRender identity example pairs its caption with the info surface. Applying opacity to the new neutral text color had dropped the caption to 4.49:1. The paired color measures 4.91:1 in the light theme.
Near black or white, sRGB has little room for chroma. If accent text used the same contrast target as neutral body text, brand and status text would turn almost white on dark surfaces. So the fourth step stops short of its preferred contrast when it would keep less than 80% of the highest chroma available above its minimum. Gray paths have almost no chroma, so neutral text keeps its preferred contrast. WCAG floors and the weak-to-normal gap still apply. On mid-tone surfaces such as Coffee, Blue, and Sunrise, the gap leaves no room, so their resting brand text stays pale.
The branch builds on the pressed control and header colors from #86684, the saturated-surface and brand contrast fixes from #86614, and the Toolbar, Widgets, and Customizer changes from #84573. The active-fill fix for #81162 landed in #82542, and the default-ramp build-order fix landed in #82525.
Independent drafts targeting trunk
#87427, #87428, and #87429 apply cleanly together on trunk at
ff082402202. #87426 now conflicts with trunk inpackages/editor/CHANGELOG.md. When rebasing this PR after #87426, keep the strong color on the inspector and complementary-area headings. If #87429 lands, retain its two fill aliases and regenerate the token fallbacks.#87453, which colors the current Site Editor v2 sidebar item with the resting brand color, landed on trunk. The heading token and its consumers are part of this PR. #87424 was closed because they depend on the new foreground step. #82528 (skip unused accent outputs) and #81088 (ItemGroup theming) remain follow-ups for after this PR.
Testing Instructions
#ffffff,#fefefe,#000000, and#010101as backgrounds.gutenberg-extensible-site-editorexperiment enabled, open Appearance → Design with the Ectoplasm or Modern admin color scheme. In the sidebar, check that the current item keeps a visible brand tint and that a hovered item has more contrast than the current one.Testing Instructions for Keyboard
Tab through the controls in Foreground Emphasis → Comparison. Use the arrow keys to change tabs. In the Button stories, press Space or Enter and compare the focused, pressed, and resting states.
Screenshots
After shows this PR at
83e58fefdf2. The sidebar and Pages screen captures compare it with trunk atff082402202, which includes #87453. The other Before images show trunk at0ca9dc73d8c. Since then, trunk has not changed the theme, UI, or components packages.The first three comparisons use the tokens that ThemeProvider generates for each admin color scheme, rendered as plain HTML.
Brand links
Each cell shows the neutral surface, a heading, body text, and a brand link at rest and on hover.
Status text
Error, warning, info, and success text with its weak variant.
Small panel
A heading, body text with a link, supporting text, an outline brand Button at rest and on hover, and an error notice.
Generated colors
Headings and body text share a color on trunk in all three themes. This PR gives them separate colors. The bottom row shows how the same
#777777seed produces a lighter base surface on trunk and a darker one on this branch.Site Editor v2 sidebar in every admin color scheme
Each capture shows the Pages screen. Pages is the current item, the pointer hovers Templates, and the other items are at rest. The labels show the measured text colors. Since #87453, both trunk and this PR use the resting brand color for the current item and the active brand color for hover. This PR changes the colors those tokens produce: the current item gets more contrast, and hover moves toward black or white.
Other admin color schemes
On Coffee, Blue, and Sunrise, the current item is paler on this PR than on trunk. Their mid-tone surfaces leave little contrast range between weak and normal text, as described in How?.
Full Pages screen in Ectoplasm
Button examples in light and dark themes
Captured from Design System → Components → Button → All Tones And Variants in Storybook. In the light theme, the neutral minimal Button label is
#1E1E1Eat rest and on hover on trunk. On this branch it changes from#464646at rest to#141414on hover. In the dark theme, the brand outline label at rest is#8EB0FFon trunk and#98B4FCon this branch.Rename dialog in the v2 Pages screen
The dialog title and the Name label are both
#1E1E1Eon trunk. On this branch the title is#141414and the label is#404040. Cancel has keyboard focus in both captures.Performance
Uncached generation of one background and six accent ramps took 4.53 ms on trunk and 19.14 ms on this branch, an increase of 14.61 ms (4.23×). Most of the increase comes from the perceptual placement. The chroma check adds about 5 ms of it. ThemeProvider memoizes the result. This measures the cost of generating a new palette.
0ca9dc73d8cMeasured with Node v24.20.0 on macOS arm64. Six alternating pairs of fresh processes ran eight warmups and 30 measured iterations each. Each iteration averaged the default light, default dark, and Ectoplasm fixtures. The table reports the median of the six process medians.
Use of AI Tools
OpenAI Codex helped implement the algorithm and tests, rebase the work, extract the independent changes, and update the benchmark and Storybook screenshots. Claude Code added the chroma check, extracted the sidebar change into #87453, rebased the branch, and captured the current screenshots and benchmark.