[UI/UX Design] Design a dark-mode tooltip and axis label contrast pass for charts #491 - #560
Open
Dubemtopsite wants to merge 1 commit into
Open
Conversation
|
@Dubemtopsite 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! 🚀 |
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.
Description
Chart tooltips and axis labels can disappear on dark chart surfaces: the previous tooltip border (
#334155) failed WCAG 2.1 AA non-text contrast (1.4.11) at ~1.7:1, and tooltip/axis tokens were only sparsely documented. This PR is a contrast pass that establishes tokenized tooltip surfaces, foregrounds, and borders plus axis-label size/color/weight for dark surfaces, and documents the system with live usage examples in the Design Tokens tool.Closes #491
What changed
Tokenized contrast definitions (
src/index.css,src/pages/DesignTokens/tokens.ts)--chart-tooltip-bg#0f172a(Slate 900) — tooltip surface layered above the#020617chart surface--chart-tooltip-fg#f8fafc(Slate 50) — 17.1:1 text contrast on the tooltip surface (WCAG 1.4.3)--chart-tooltip-border#334155→#64748b(Slate 500) — 3.75:1 non-text boundary contrast against the tooltip surface and 4.24:1 against the app surface (WCAG 1.4.11)--chart-axis-label-color#94a3b8(Slate 400) — 7.87:1 on#020617(≥ 4.5:1 for 12px small text)--chart-axis-label-size0.75rem(12px base, rem-based so it reflows with 200% zoom / large-text preferences)--chart-axis-label-weight500— new, keeps 12px axis text crisp on dark surfacesAll tokens now carry WCAG-documented descriptions in the Design Tokens tool.
Usage examples in the Design Tokens page (
ChartTooltipContrastDemo.tsx)New section — "Dark-Mode Tooltip & Axis Label Contrast" — rendered between the categorical palette guidelines and the token tables:
Validation
contrast.ts):jest-axereports 0 violations on the new section in both dark and light surfaceseslint+tsc --noEmit). Pre-existing repo-wide lint/type/test failures (e.g.,DistributionDashboard.tsx,AuditTrail.tsx,KycSelfieCapture.tsx,Tabs.tsx) are unrelated and unchanged by this PREdge cases covered
forced-colorspaletteinset-inline,text-align: start)