Skip to content

feat(tokens): redesign color palette scales (QCDL-29) - #81

Merged
Fernando Jesus (fernandorjesus) merged 2 commits into
mainfrom
feature/QCDL-29-tokens
Jul 20, 2026
Merged

feat(tokens): redesign color palette scales (QCDL-29)#81
Fernando Jesus (fernandorjesus) merged 2 commits into
mainfrom
feature/QCDL-29-tokens

Conversation

@fernandorjesus

Copy link
Copy Markdown
Collaborator

Summary

  • Redesigns the purple/gray/blue/green/yellow/red color scales in src/styles/tokens.css with fuller step ranges (e.g. purple-50 through purple-950, gray-50 through gray-900).
  • Updates Colors.stories.tsx to mirror every token 1:1 (verified with a diff between tokens.css --color-* vars and the story's cssVar references — zero missing, zero stale).
  • Normalizes a stray hex-case mismatch in tailwind.config.ts and ContextMenu.stories.tsx (#49317A#49317a, same value).

⚠️ Breaking visual change

This is not purely additive — several pre-existing steps changed hex value, not just new steps being added (e.g. purple-500 #9664fa#7e56c9, gray-900 #323232#1a1a2e, blue-600 #0068b3#1d6bb5). Only purple-800/900/600, white, and black kept their values. ~59 of ~90 components in src/components/ui use at least one class whose hex changed — this affects the visual appearance of already-published components in every consumer app (casa-da-lais, casa-da-lais-atendente, chat-module) without any prop/API change.

Versioning: publish.yml takes the published version straight from the GitHub Release tag, not from package.json — there's no automatic semver enforcement. Please consider at least a MINOR bump when cutting the release, given the visual impact.

Contrast findings (WCAG AA, computed from real token hex pairs used in source)

  • Badge color="purple" (bg-purple-300 + text-purple-800): 8.28:1 → 4.03:1 — now fails AA (4.5:1 needed for normal text). Regression introduced by this change.
  • Snackbar severity="success" (white text on bg-green-600): 4.66:1 → 3.30:1 — now fails AA. Regression introduced by this change.
  • Pre-existing, not introduced here: Snackbar severity="warning" already failed AA before (1.73:1) and still does (2.94:1).
  • All other status pairs (Alert/Toaster/Badge success/info/warning/danger with -50 bg + -800 text) remain comfortable (6.6–8.2:1).

No automated test/CI covers color contrast in this repo (no jest-axe, no Storybook addon-a11y), so these were computed manually via the WCAG relative-luminance formula, not caught by the pre-PR gate.

Test plan

  • pnpm run type-check — clean
  • pnpm test — 81 suites / 2324 tests passed
  • pnpm run build — succeeds
  • pnpm biome ci . — clean (1 pre-existing informational file-size notice on Menu.test.tsx, unrelated)
  • Decide whether to adjust purple-300 / green-600 to restore AA contrast for Badge purple and Snackbar success, or accept as a known tradeoff of the new palette
  • Confirm semver bump plan for the release given the visual breaking change

Expands and rebalances purple/gray/blue/green/yellow/red scales in
tokens.css with fuller step ranges (e.g. purple 50-950, gray 50-900),
updates Colors.stories.tsx to mirror every token 1:1, and normalizes a
stray hex case mismatch in tailwind.config.ts / ContextMenu stories.

Note: this changes the hex value of several pre-existing steps (not
just additive new ones), which is a visual breaking change for any
consumer already using the affected Tailwind classes. Flagging for the
release: no automatic semver bump is enforced by CI (publish.yml takes
the version straight from the GitHub Release tag), so please consider
at least a MINOR bump when cutting the release.

Known contrast regressions introduced by the new values (WCAG AA,
computed from the actual token hex pairs):
- Badge color="purple" (bg-purple-300 + text-purple-800): 8.28:1 -> 4.03:1 (fails AA)
- Snackbar severity="success" (white text on bg-green-600): 4.66:1 -> 3.30:1 (fails AA)
Pre-existing, not introduced here: Snackbar severity="warning" already failed AA before this change (1.73:1) and still does (2.94:1).
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 17, 2026 3:17pm

Request Review

@fernandorjesus
Fernando Jesus (fernandorjesus) merged commit bbd4ee9 into main Jul 20, 2026
4 of 5 checks passed
@fernandorjesus
Fernando Jesus (fernandorjesus) deleted the feature/QCDL-29-tokens branch July 20, 2026 12:48
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.

2 participants