mirror of https://github.com/vuejs/vitepress
axe's label-content-name-mismatch rule flags the search button (#5401): its visible text is "Search ⌘ K" while its accessible name is "Search". aria-hidden on the keys does not help — the rule counts visually rendered text, since WCAG 2.5.3 is about what sighted speech-input users see and say. The button was arguably conformant as it was: 2.5.3 constrains the label, and the keycaps are a shortcut hint, not the label. Nobody says "click Search command K". The glyphs move to CSS anyway because it costs nothing visible and layers things right: the DOM text now contains exactly the label, so speech software gets no stray "K" target, strict audits pass without a human ruling them false positives, and the decorative hint lives in the presentation layer where decorative content belongs. Screen readers are unaffected — the keys were already aria-hidden — and aria-keyshortcuts keeps carrying the shortcut semantics. Also folds the two display-toggled kbd elements into one whose content switches per platform. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>pull/5390/merge
parent
9bebd092eb
commit
60f656b0ec
Loading…
Reference in new issue