Skip to content

Refactor/design tokens#372

Closed
mxrtins04 wants to merge 3 commits into
Grainlify:mainfrom
mxrtins04:refactor/design-tokens
Closed

Refactor/design tokens#372
mxrtins04 wants to merge 3 commits into
Grainlify:mainfrom
mxrtins04:refactor/design-tokens

Conversation

@mxrtins04

Copy link
Copy Markdown
Contributor

Closes #24
Introduces a CSS custom property token layer and migrates three components off inline hex, establishing the pattern for the remaining 70+ files.
src/styles/theme.css defines tokens under :root and .dark for surface, background, text, and brand color roles. Hardcoded values like rgba(201,152,58,...) are consolidated here.
src/styles/tailwind.css extends Tailwind with semantic utilities (bg-surface, text-brand, text-primary, border-subtle, etc.) mapped to the CSS vars.
RoleSwitcher.tsx replaces bg-[#1a1612] / bg-[#8b7d6b] and theme === 'dark' branches with semantic tokens. Same migration applied to Modal.tsx and ProjectCard.tsx.
ThemeContext.test.tsx covers toggle behaviour, .dark class application on the document root, and token resolution for both themes.
README.md gets a "Design tokens" section documenting the naming convention, how to add new tokens, and how to extend the Tailwind map.
ThemeContext.tsx toggle logic is untouched. No components outside the three listed are modified. No inline style props receive untrusted values. Styling-only change.

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

hey @mxrtins04, thanks for jumping in! closing this pr because the author needs to be assigned to the linked issue (#24) before opening a pr. please comment on the issue requesting assignment, wait to be assigned, then re-raise your pr. this keeps work fairly distributed across contributors. hope to see a revised pr from you soon!

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.

Centralize theming with CSS design tokens to replace inline theme === 'dark' hex colors

2 participants