fix: make heading anchor links always visible and keyboard accessible - closes #2709 - #2710
Closed
github-actions[bot] wants to merge 1 commit into
Closed
fix: make heading anchor links always visible and keyboard accessible - closes #2709#2710github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
closes #2709 - Remove opacity-0 and group-hover:opacity-100 classes to always show anchor icons - Remove group and relative classes from heading (no longer needed) - Add align-middle class for better vertical alignment - Fixes three accessibility issues: 1. Icons are now visible and tappable on touch devices (no @media hover limitation) 2. Invisible layout space no longer causes unexplained blank lines 3. Keyboard focus is now visible (satisfies WCAG 2.4.7) - Icon styling (text-gray-400 hover:text-ssw-red) provides subtle affordance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
Thanks — but the direction on #2709 has changed, so this needs to be redone. The issue now prefers the hybrid fix rather than Option A (always visible). The team wants desktop headings to stay clean, with the icon hover-revealed as it is today, and only made permanent where hover does not exist: className="inline-block ml-2 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 focus-visible:opacity-100 transition-opacity duration-200 no-underline"Two things this PR does that are no longer wanted:
Closing this in favour of a fresh attempt against the updated issue body. See the revised Suggested Fix and Acceptance Criteria in #2709. |
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.
Summary
This PR fixes three critical accessibility issues with heading anchor links (the 🔗 icon next to h2/h3/h4 on rule pages):
@media (hover: hover)wrapper aroundgroup-hovervariants)Changes
File:
components/typography-components.tsxopacity-0 group-hover:opacity-100classes from anchor linkgroupandrelativeclasses from heading (no longer needed)align-middleclass for better vertical alignmenttext-gray-400 hover:text-ssw-red) provides subtle affordance while maintaining visibilityAcceptance Criteria
Technical Details
Previously, the component used:
opacity-0(hidden by default)group-hover:opacity-100(reveal on hover)This approach had issues with Tailwind v4's media query wrapper
@media (hover: hover), which prevents the reveal on touch devices where there is no hover capability.The new approach simply makes the icon always visible with subtle styling (gray text that turns red on hover), which is a cleaner solution that works across all input methods while maintaining the visual hierarchy through color differentiation.