Repository navigation
fix(theme): improve Ruins light-theme contrast and add CI guards - #167
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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
Fixes severe light-theme contrast issues across the Ruins theme and adds automated ESLint, CSS, rendered-component, and CI guards so future light themes stay WCAG AA compliant.
Root causes fixed
theme-exemptcomments:RecapHero,RecapSection,RecapNodesChart,RecapCalendarSection,RecapGenresPlatformsSection,RecapTopGamesSection,RecapBacklogSection,RecapCommunitySection,RecapAwardsCard,RecapFooter,RecapGoalCard), replacing unreadable#adadad/#808080/#fffffftext, solid black chart/heatmap fills (#161616/#1c1c1c), and dark card surfaces (#2b130e) with theme tokens.Supporter,Wrappedchrome,Awards,Events,Daily,Journal,Blog,Game,Profile, mobileCardRow/CardSection, webLandingHeader/GlobalAppShell), shrinkingpackages/config-eslint/color-baseline.jsonfrom 88 files (895 violations) to 32 files (742 violations).apps/mobile/src/components/globals.css), filled mobile badges (apps/mobile/src/components/theme.module.css),SettingsButtonprimary/danger variants,EventCardParts,AwardsVoteBarContent,AwardsEventBand, andConsoleReleases.module.css.upcomingEyebrowto use filled contrast tokens (--gn-brand-filled-text,--gn-danger-filled-text,--gn-state-played-filled-text,--gn-tertiary-filled-text).RuinsPrimitives.module.cssin mobile production builds:.primitivesAnchorclass referenced byRuinsOverlay,screens/index.ts, andruinsScreens.tsxso bundlers never silently drop the 1,111-line Ruins stylesheet.--gn-danger-filled-textand--gn-state-played-filled-textinpackages/ui/scripts/generate-themes.tsand madegetTintTextenforce WCAG AA (4.5:1) acrosssecondary,surface, andbackground.brandTint(#CFCAB4) andstatus.successText(#3B502F) so text onbrand-tintandstate-played-tintstays ≥ 4.5:1.Preventive CI & lint guards
gamenode/no-unsafe-theme-pairs+ CSS unsafe-pair detection (flags solid accent/brand/danger backgrounds paired with body text tokens, and--color-selected: var(--gn-text)on selected Ionic tabs).apps/mobile/src/theme/theme-contrast-catalog.test.tsto enforce AA across surfaces and filled/tint token pairs for every theme inTHEME_CATALOG.apps/mobile/src/theme/light-theme-contrast.test.tsx(renders key screens under every light theme inTHEME_CATALOGand checks resolved WCAG AA contrast) andapps/mobile/src/theme/ruins-primitives-bundle.test.ts.pnpm colors:check,pnpm --filter @repo/eslint-config test, andpnpm --filter mobile exec vitest run src/theme/unconditionally into.github/workflows/ci.yml.Changeset
.changeset/ruins-light-theme-contrast.md(web: patch,mobile: patch)Verification
pnpm themes:check✅pnpm colors:check✅pnpm --filter @repo/eslint-config test(26/26) ✅pnpm --filter mobile exec vitest run src/theme/(35 files / 403 tests) ✅pnpm lint(6/6) ✅pnpm type-check(7/7) ✅pnpm release:plan origin/main HEAD&pnpm test:releases✅390×844) with Ruins active andwindow.__gnContrastMonitor.run()reporting 0 issues.