Fix Cookie Notice policy link accessibility (WCAG 2.4.4) and hover contrast - #316
Merged
Merged
Conversation
The banner's cookie-policy link was always labeled with the generic "Learn more" string, which fails WCAG 2.4.4 (Link Purpose in Context) — out of context, a screen reader user has no way to know it leads to the cookie policy. Use the linked page's own title instead, falling back to "Learn more" only if the page has no title. Also add explicit hover/focus color rules to .frbl-cookie-notice__link, which previously had none — letting a theme's own global a:hover style take over and make the link's text unreadable against its background. Closes #315 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
Closes #315.
What changed
get_the_title( $policy_page_id )), falling back to the original "Learn more" string only if the page has no title..frbl-cookie-notice__linkhad no explicit:hover/:focuscolor, so a theme's own globala:hoverstyle could take over and make the link's text unreadable against its background (reported live on a production site). Added explicit hover/focus rules mirroring the pattern already used for.frbl-cookie-notice__button:hover, plus a visible:focus-visibleoutline.white-space: nowrapfrom the link, since a real page title can be longer than "Learn more" and shouldn't be forced onto one line/overflow.Tests
tests/Unit/CookieNoticeLinkTest.php: policy-page-title used as link text, falls back to "Learn more" when the page has no title, no link rendered when no policy page is configured.composer lint/composer phpstan: clean.composer testlocally (no WordPress test DB provisioned in this environment) — relying on CI's PHPUnit workflow to confirm.🤖 Generated with Claude Code