Skip to content

style(themes): use theme tokens in Year in Code story (#3791) - #3844

Open
PranshuPujara wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
PranshuPujara:issue#3791
Open

PranshuPujara wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
PranshuPujara:issue#3791

Conversation

@PranshuPujara

Copy link
Copy Markdown
Contributor

Hey @Priyanshu-byte-coder

What and why

Replaces 18 hardcoded Tailwind palette classes (text-slate-50, text-slate-400, text-slate-200, text-slate-100, text-slate-300, text-slate-950, border-rose-400/50, bg-rose-500/10, text-rose-300, text-rose-100, border-rose-200, bg-rose-100, text-rose-950, border-amber-300/40, bg-amber-300/10, text-amber-100) in src/components/WrappedExperience.tsx with semantic theme tokens (text-[var(--foreground)], text-[var(--muted-foreground)], border-destructive/50, bg-destructive/10, text-destructive, border-warning/40, bg-warning/10, text-warning, text-[#05070f]). This allows the Year in Code story to render legibly across all themes (Arcade, Daylight, Terminal, Synthwave).

Closes #3791

How to test

  1. Run pnpm dev and visit http://localhost:3000/wrapped?year=2024.
  2. Toggle the theme between Arcade and Daylight via the navbar/settings theme selector.
  3. Verify all slide copy, year selector label, mini stat titles, and warning/error banners adapt their text and borders to the active theme palette rather than staying fixed slate/rose/amber.
  4. Verify grep -nE '(bg|text|border|from|to|via|ring)-(slate|gray|zinc|neutral|red|orange|amber|yellow|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-[0-9]{2,3}' src/components/WrappedExperience.tsx returns 0 matches.

Checklist

  • I was assigned to the linked issue before I started
  • pnpm run lint, pnpm run type-check and pnpm test pass locally
  • Tests added or updated where it makes sense
  • UI changes follow the arcade design system and work on mobile and with the keyboard
  • I can explain every line of this change (AI tools are fine; see the AI policy)

Winter of Code Social

Pranshu Pujara

@github-actions github-actions Bot added the type:design GSSoC type bonus: UI/design (+10 pts) label Nov 26, 2026

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and this is partly my fault: the issue was wrong about this file. The Year in Code story is deliberately an always-dark "cabinet" (see .wrapped-screen in globals.css: a fixed dark gradient in every theme). Switching its text to var(--foreground) / var(--muted-foreground) makes it dark text on that dark screen in Daylight.

So please keep the light text colours (text-slate-*) as they are and add a short comment that the story is always dark. Only the error and warning boxes can move to destructive / warning, and only if they still read well on the dark background in Daylight. Please add screenshots of the story in Arcade and Daylight.

@PranshuPujara

Copy link
Copy Markdown
Contributor Author

Updated per your feedback:

  1. Preserved light text colors (text-slate-*): Reverted all text styles so they stay high-contrast against the always-dark .wrapped-screen background, preventing dark-on-dark text in Daylight.
  2. Documented dark cabinet: Added an inline comment clarifying that the Year in Code story is an intentionally dark arcade cabinet across all themes.
  3. Semantic tokens on error/warning boxes:
    • Error banner now uses border-destructive/50 bg-destructive/10 and border-destructive bg-destructive text-destructive-foreground on the action button while retaining light text-rose-100 text for readability on dark backgrounds.
    • Partial year banner now uses border-warning/40 bg-warning/10 while retaining light text-amber-100 text for readability.

Screenshots in Arcade and Daylight attached below.

wrapped-arcade-2024

wrapped-arcade-2024

wrapped-daylight-2024

wrapped-daylight-2024

Pranshu Pujara

This branch has not been deployed

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

Labels

type:design GSSoC type bonus: UI/design (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme tokens instead of fixed colours in the Year in Code story

2 participants