Repository navigation
Conversation
…tems Menu items, combobox options, and the New workspace "See all templates" link only changed background color on focus, which falls below the 3:1 contrast WCAG 2.4.7 requires. Add a 2px inset content-link ring.
Collaborator
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Menu items, combobox options, and the New workspace "See all templates" link only changed background color on keyboard focus (
surface-primarytosurface-secondary). That is below the 3:1 contrast WCAG 2.4.7 requires, and a checked radio item already has that background, so focusing it showed no change at all. Reported by the Deque audit of/workspaces(issues 2867143 and 2871494, dark and light mode).This adds a 2px inset
ring-content-linkfocus ring to the shared primitives, so every dropdown, context menu, and combobox gets it:menuItemClass(DropdownMenuItem,CheckboxItem,SubTrigger,ContextMenuitems) andDropdownMenuRadioItem:focus-visible, so it only appears for keyboard focus.CommandItemand theFilterComboboxrow:data-[selected=true], because focus stays in the cmdk input and the browser can't tell keyboard highlighting apart from mouse hover. The ring also shows on hover in these lists.WorkspacesButton:focus-visible.On main, the workspaces page uses
FilterComboboxin place of the preset radio menu the audit saw on staging, so both are covered.Ring contrast against the focused item background: about 4.7:1 in light mode (
#2463EBon#F4F4F5) and about 7:1 in dark mode (#61A6FAon#18181B).Before / after
Captured from
./scripts/develop.shin light mode, using only the keyboard.Decision log and verification
DropdownMenu,Command, orFilterComboboxitem and the same gap exists app-wide.ring-insetso the ring is not clipped byoverflow-hiddenmenu containers and does not shift layout.focus-visiblefor Radix menu items so mouse users don't see the ring; cmdk lists can't make that distinction, so they key offdata-selected.box-shadowon each focused element includes the 2px inset ring, in both light and dark themes, including the checked + focused radio item.make pre-commitandmake pre-pushpassed.