Repository navigation
fix: use Highlight/HighlightText for MenuItem hover and open-submenu states in forced colors mode - #38
Open
mainframev wants to merge 1 commit into
Open
fix: use Highlight/HighlightText for MenuItem hover and open-submenu states in forced colors mode#38mainframev wants to merge 1 commit into
mainframev wants to merge 1 commit into
Conversation
…states in forced colors mode
mainframev
force-pushed
the
fix/menu-hc-hover
branch
from
October 22, 2026 01:30
ce987cf to
17c5cdf
Compare
This branch has not been deployed
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.
Previous Behavior
In forced colors mode, hovering a
MenuItem(and every item built on its styles: checkbox, radio, link, switch, split) kept theCanvasbackground and only turned the labelHighlight. TheborderColor: 'Highlight'rule had no effect because the item has no border. The icon, checkmark, secondary content and subtext kept their token colors, which forced colors maps toCanvasText. The open-submenu state had the same problem.New Behavior
Hovered and open-submenu items use the standard high contrast treatment: a
Highlightbackground, withHighlightTexton the item and all of its slots.forcedColorAdjust: 'none'. Without it, Chromium paints aCanvastext backplate over theHighlightbackground and the label turns into a black box. Tab and InteractionTag do the same thing.CanvasandGrayText. They resetforcedColorAdjusttoautoand now cover the checkmark and secondary content as well.The screenshots come from Chromium's forced-colors emulation (
emulateMedia({ forcedColors: 'active' })) on the MenuList Default, Checkbox items and Nested submenus stories.Verification:
nx run-many -t test type-check lint -p react-menupasses.Related Issue(s)