fix: audit and restore accessible link styles (#172)#295
Open
wagmiiii wants to merge 1 commit into
Open
Conversation
- Add tokenized --visited states to ensure AA contrast
- Define .link-body with 1px default underlines and visited state
- Define .link-nav for hover/focus behavior without underlines
- Restore missing underlines to inline body links
- Add tests to ensure design system link classes are applied correctly
|
@wagmiiii Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@GBOYEE has applied to work on this issue as part of the Stellar Wave Program's 6th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @GBOYEE to this issue. |
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 #172
Summary
This PR resolves accessibility compliance for WCAG 2.1 SC 1.4.1 by decoupling inline link presentation from color alone. Global utility classes have been introduced and implemented across the UI to
explicitly separate standard "body" links (which require default underlines and visited states) from structural "navigation" links (which rely on hover states but omit underlines).
What Changed
• src/index.css : Introduced --visited tokens for both light and dark themes. Created the .link-body utility class (adding a 1px default underline and tokenized :visited state) and .link-nav
class (explicitly opting out of text decoration).
• src/App.tsx : Systematically applied .link-nav to header and footer navigation links ( and ), preventing underlines while inheriting hover states. Targeted the Documentation and
Support footer links via a CSS attribute selector to inject the :visited color without breaking nav structural styles.
• src/components/Breadcrumb.tsx : Removed redundant inline CSS overrides ( text-decoration: none ) and replaced them with the global .link-nav token class.
• src/pages/ApiDetailPage.tsx : Removed hardcoded inline styles ( textDecoration: "none" ) from the API provider elements and assigned .link-body , successfully restoring inline underlines.
• docs/UI-Design-System.md : Formalized and documented .link-body and .link-nav behavior within the internal UI Design System guide.
Note regarding MarketplacePage: The original issue ticket requested an audit of body links within MarketplacePage.tsx . Upon inspection, no inline text body links were present inside MarketplacePage.tsx
or its child components (like ApiCard.tsx ), so no structural updates were strictly necessary in those specific files.
Key Design Decisions
• text-decoration-thickness : Hardcoded to 1px on .link-body . This keeps the underline deliberately subtle in dark mode themes (avoiding visual weight bleed) while completely satisfying the default
AA accessibility requirements for link visibility.
• Footer :visited Handling: Rather than assigning the Documentation and Support footer links to .link-body (which would have forced an awkward underline in the middle of a footer block), I used CSS
attribute selectors on .link-nav[href*="documentation"] to inject the :visited state styling while correctly preserving their structural presentation as unlined navigation items.
Acceptance Criteria
[✓] Body-text inline links get a 1px underline by default.
[✓] Navigation links retain hover/focus styles without underline.
[✓] :visited token defined for documentation/help links.
[✓] Breadcrumb separators remain non-link characters.
[✓] Manual contrast check met for visited links in both themes.
[✓] Dark mode underline thickness is strictly verified.
Test Output & Coverage
(Note: Full file coverage metrics for index.css and .tsx pages remained perfectly stable, with styling assertions verified completely via DOM elements).
Honest Follow-ups
There are currently unrelated Vitest unit test failures running on main (mostly related to window.matchMedia errors inside the FiltersBottomSheet.test.tsx and some Schema Validation
inconsistencies). While not tied to this UI/UX branch, they should be cleaned up by the team in a subsequent chore PR.
Security Note
All added href logic passes standard anchor linting. No dangerouslySetInnerHTML injections or unsafe unescaped variables were introduced during the layout alterations, maintaining existing
sanitization structures inside React.