Repository navigation
MenuItem: Match the info text color to the label in pressed items - #87153
Conversation
Pressed buttons opt out of forced colors so they can show the system selection fill. The info text kept its own color on that fill, so it now inherits the label's color.
🤖 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: +23 B (0%) 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. As a user I want to be able to create a navigation overlay for a specific navigation block in
|
…rdPress#87153) * MenuItem: Keep info text readable in pressed items in forced colors mode Pressed buttons opt out of forced colors so they can show the system selection fill. The info text kept its own color on that fill, so it now inherits the label's color. * Add changelog link and remove comment * Match the info color to the label in pressed items in every color mode Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
Follow-up to #86393.
Gives the
infotext of a pressedMenuItemthe same color as the item's label, in normal and forced colors modes.Why?
The
infotext keeps its own gray (#6e6e6e) on a pressed item, so it doesn't follow the pressed colors that the label uses:#1e1e1e) at about 3.3:1 contrast. On a disabled pressed item, it is darker than the disabled label, so it looks enabled.infotext keeps the same gray on theSelectedItemfill, or on theGrayTextfill when the item is disabled withdisabledoraria-disabled.How?
The info text of a pressed item inherits the button's color in every color mode, as MenuItem already does for the info text of highlighted and expanded items.
Testing Instructions
isPressedtotrue. The description text has the same color as the "Menu Item 1" label on the dark pressed fill.aria-disabled="true"to the button. The description has the same disabled color as the label. Replace it withdisabled, and the result is the same.active.aria-disabledanddisabledchecks, and the description still matches the label on the gray fill.isPressedtofalse, in both modes. The description looks the same as ontrunk.dark, and in Firefox with forced colors turned on.Screenshots or screencast
A pressed item and a pressed
aria-disableditem, in normal mode and in forced colors mode with light and dark system colors.