Skip to content

fix(theme): improve Ruins light-theme contrast and add CI guards - #167

Merged
Lamarcke merged 1 commit into
mainfrom
fix/ruins-theme-contrast
Nov 22, 2026
Merged

Lamarcke merged 1 commit into
mainfrom
fix/ruins-theme-contrast

Conversation

@Lamarcke

Copy link
Copy Markdown
Member

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

  • Legacy hard-coded dark colors & misused theme-exempt comments:
    • Tokenized the entire Year Recap and Goal screens (RecapHero, RecapSection, RecapNodesChart, RecapCalendarSection, RecapGenresPlatformsSection, RecapTopGamesSection, RecapBacklogSection, RecapCommunitySection, RecapAwardsCard, RecapFooter, RecapGoalCard), replacing unreadable #adadad/#808080/#ffffff text, solid black chart/heatmap fills (#161616/#1c1c1c), and dark card surfaces (#2b130e) with theme tokens.
    • Migrated 44 additional shared UI components (Supporter, Wrapped chrome, Awards, Events, Daily, Journal, Blog, Game, Profile, mobile CardRow/CardSection, web LandingHeader/GlobalAppShell), shrinking packages/config-eslint/color-baseline.json from 88 files (895 violations) to 32 files (742 violations).
  • Unsafe semantic token pairs (dark-on-dark in light themes):
    • Fixed mobile selected tab bar icon (apps/mobile/src/components/globals.css), filled mobile badges (apps/mobile/src/components/theme.module.css), SettingsButton primary/danger variants, EventCardParts, AwardsVoteBarContent, AwardsEventBand, and ConsoleReleases.module.css .upcomingEyebrow to use filled contrast tokens (--gn-brand-filled-text, --gn-danger-filled-text, --gn-state-played-filled-text, --gn-tertiary-filled-text).
  • Vite tree-shaking of RuinsPrimitives.module.css in mobile production builds:
    • Added a local .primitivesAnchor class referenced by RuinsOverlay, screens/index.ts, and ruinsScreens.tsx so bundlers never silently drop the 1,111-line Ruins stylesheet.
  • Theme generator & Ruins tokens:
    • Generated --gn-danger-filled-text and --gn-state-played-filled-text in packages/ui/scripts/generate-themes.ts and made getTintText enforce WCAG AA (4.5:1) across secondary, surface, and background.
    • Tuned Ruins brandTint (#CFCAB4) and status.successText (#3B502F) so text on brand-tint and state-played-tint stays ≥ 4.5:1.

Preventive CI & lint guards

  • Added ESLint rule 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).
  • Expanded apps/mobile/src/theme/theme-contrast-catalog.test.ts to enforce AA across surfaces and filled/tint token pairs for every theme in THEME_CATALOG.
  • Added apps/mobile/src/theme/light-theme-contrast.test.tsx (renders key screens under every light theme in THEME_CATALOG and checks resolved WCAG AA contrast) and apps/mobile/src/theme/ruins-primitives-bundle.test.ts.
  • Wired pnpm colors:check, pnpm --filter @repo/eslint-config test, and pnpm --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 ✅
  • Verified visually on mobile viewport (390×844) with Ruins active and window.__gnContrastMonitor.run() reporting 0 issues.

@Lamarcke
Lamarcke merged commit d8a035f into main Nov 22, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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.

1 participant