Repository navigation
Components: Replace the accent-darker SCSS variables with design tokens - #86797
Conversation
Use the brand foreground token for the ToolsPanel reset label, and let Button's disabled tertiary style apply to MenuItem instead of overriding it with the accent-darker color and reduced opacity. Remove the unused `$components-color-accent-darker-10` and `-20` SCSS variables.
🤖 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: -110 B (0%) Total Size: 8.69 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. does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in
|
Dropping the disabled tertiary opacity removed the only cue that the aria-disabled "Reset all" item was disabled in forced colors mode.
…lors Button fills pressed disabled items with GrayText and sets a Canvas foreground. The aria-disabled GrayText color loaded after it and hid the label and icon.
|
Always like more cleanup and consistency work! In Chrome's dark |
Chromium forced colors gave the info text the enabled text color while the label used GrayText.
ciampo
left a comment
There was a problem hiding this comment.
LGTM 🚀
One extra nit: label and description now match for an unpressed disabled item. Could we also let the description inherit when the item is pressed, keeping the :not(.is-pressed) guard just on color: GrayText?
I had split this out to #87153 since it was an existing/separate issue discovered in testing. I will continue there 👍 |
…ns (WordPress#86797) * Components: Replace the accent-darker SCSS variables with design tokens Use the brand foreground token for the ToolsPanel reset label, and let Button's disabled tertiary style apply to MenuItem instead of overriding it with the accent-darker color and reduced opacity. Remove the unused `$components-color-accent-darker-10` and `-20` SCSS variables. * Add the changelog link * MenuItem: Show aria-disabled items as disabled in forced colors mode Dropping the disabled tertiary opacity removed the only cue that the aria-disabled "Reset all" item was disabled in forced colors mode. * MenuItem: Keep the pressed foreground for disabled items in forced colors Button fills pressed disabled items with GrayText and sets a Canvas foreground. The aria-disabled GrayText color loaded after it and hid the label and icon. * MenuItem: Show disabled info text in the disabled color in forced colors Chromium forced colors gave the info text the enabled text color while the label used GrayText. Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
Replaces the remaining usages of the
$components-color-accent-darker-10SCSS variable in@wordpress/componentswith design tokens, and removes the$components-color-accent-darker-10and$components-color-accent-darker-20SCSS variables. Follow-up to #86683.Why?
@wordpress/componentsis moving off its--wp-components-color-*variables and onto the@wordpress/themedesign tokens. These were the last usages of the accent-darker SCSS variables, anddarker-20had no usages left.How?
Neither usage represents a hover or pressed state, so both use the regular brand tokens instead of the darker
-activeones. With the opacity dropped, the MenuItem disabled tertiary override would compute the same color and background as Button's own disabled tertiary style, so the override is removed instead of migrated.Testing Instructions
Screenshots or screencast
The "Reset" label changes from
#2145e6to the brand foreground color,#3858e9by default.The disabled "Reset all" item changes from a faded blue to the gray disabled color.
In forced colors mode, the disabled "Reset all" item was previously faded by the opacity. It now uses the system disabled color, like the other disabled items in the menu. This applies to every MenuItem with
aria-disabled, which browsers do not give the disabled color on their own.