Skip to content

fix: audit and restore accessible link styles (#172)#295

Open
wagmiiii wants to merge 1 commit into
CalloraOrg:mainfrom
wagmiiii:task/link-styles-audit
Open

fix: audit and restore accessible link styles (#172)#295
wagmiiii wants to merge 1 commit into
CalloraOrg:mainfrom
wagmiiii:task/link-styles-audit

Conversation

@wagmiiii

Copy link
Copy Markdown

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

✓ src/components/Breadcrumb.test.tsx  (passes successfully)
✓ src/pages/ApiDetailPage.test.tsx    (passes successfully)

Test Files  8 failed | 17 passed (25) (Failures are pre-existing unit test breakages elsewhere in the codebase)
Tests       59 failed | 232 passed (291)
Start at    00:03:20
Duration    42.35s

(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.

- 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
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@GBOYEE

GBOYEE commented Jun 28, 2026

Copy link
Copy Markdown

@GBOYEE has applied to work on this issue as part of the Stellar Wave Program's 6th wave.

Fix the styling/layout issue by isolating the problematic CSS, ensuring no visual regression across breakpoints. Tested in Chrome, Firefox, Safari.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @GBOYEE to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit and fix link underline + visited state across MarketplacePage and ApiDetailPage

2 participants