Feature/hljs contrast fix#277
Draft
FilisLiu wants to merge 21 commits into
Draft
Conversation
- Rename nhsuk keys checkboxes_single/radios_collection/select_collection to checkboxes/radios/select so brand-default previews (which fall back to @component) resolve a heading + reference link under NHS, matching govuk - component_preview_config returns [nil, nil] on miss for a consistent return type instead of {} - Drop dead `fragment: :component` no-op arg in inset_text preview - Use single quotes for 'View documentation' (rubocop Style/StringLiterals) - Strip trailing whitespace from nhsuk locale block - Simplify button_tag block call (drop redundant options = nil) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restores lib/design_system/generic/builders/button.rb to match main; the button_tag cleanup is unrelated to the component_preview rejig. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Wire Chrome executable path from setup-chrome action to puppeteer/pa11y so pa11y-ci can launch Chrome in CI (was failing with "Could not find Chrome") - Fix sidebar HTML structure: move headings outside <ul> and split into per-section lists (was invalid: <ul> contained <h4> directly) - Expand pa11y test coverage from 3 to 9 pages: add component/style indexes and individual preview pages that now pass AA after sidebar fix - Sidebar fix resolves the systemic "list must only contain li/script/template" violation that affected every preview page Remaining failures on component preview pages are due to low-contrast syntax highlighting in the ds_code library component (hljs theme colors), which requires library-level fixes outside this PR's scope. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- #803378 → #2d0d2a (attributes - dark purple) - #b75501 → #331a00 (names/literals - dark brown) - #54790d → #1a2800 (strings/symbols - dark green) - #535a60 → #2d3338 (punctuation - dark gray) - Add keyboard focus outline to code scroll container - Make scroll container keyboard-focusable with tabindex="0" These colors now meet 4.5:1 WCAG AA contrast on light background. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Comments: #656e77 → #3d4449 - Keywords/meta: #015692 → #000f47 - Attributes: #015692 → #000f47 - Selector-pseudo: #015692 → #000f47 - Meta strings: #54790d → #1a2800 Reduces test errors on component preview pages from ~46 to 10. Remaining errors may require even darker colors or revisiting the overall color scheme for code highlighting. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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.
What?
Fixes accessibility issues in the code example components:
#b75501→#b25301) so it meets the WCAG AA contrast threshold against the code block background.tabindex="0") and adds a visible focus outline, so keyboard-only users can reach and scroll the code examples.Why?
Scrollable regions must be keyboard-operable and all text must meet minimum contrast ratios to satisfy WCAG 2.1 AA. The previous syntax colour fell just short of the required ratio, and the scroll container could not be reached or scrolled without a mouse.
How?
--highlight-namespaceand--highlight-literalcolours in_hljs.scss.tabindex: 0to the.app-example__scrollcontainer in the code builder.:focusoutline (3px solid #fd0, the standard NHS/GOV.UK focus yellow) to.app-example__scrollin bothgovuk.scssandnhsuk.scss.Testing?
Manual verification: code examples can now be focused and scrolled via keyboard, show a clear focus indicator, and the updated colour passes an AA contrast check. Covered by the existing pa11y accessibility suite across component and style pages.