Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace hard-coded color values with (hardcoded) CSS variables from site theme #404

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Jul 31, 2024

A little complex, see if it makes sense.
the main thing is isomer-components export a tailwind plugin that basically takes in a json object of colors to inject into :root. But only template needs it. The rest will inject css vars with their various implementation.

  • for studio, the css variables injected into iframe using chakra
  • for component’s storybook, css variable injected with global stylesheet (eventually using theme manager i’d expectd)

TL;DR

Migrated brand colors to CSS variables and introduced a new isomerSiteTheme plugin for (future) dynamic theme injection.

What changed?

  • Updated colors.ts to use CSS variables for brand colors.
  • Introduced isomerSiteTheme in site-theme.ts to dynamically inject CSS variables.
  • Removed the old MOH theme from index.ts and integrated the new isomerSiteTheme plugin.

How to test?

Should have no changes for components that were already using the previously (more) hardcoded tokens.

Why make this change?

This change is motivated by the need for better theme management and dynamic theming capabilities using CSS variables.

Copy link

vercel bot commented Jul 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 9:44am

Copy link

linear bot commented Jul 31, 2024

Copy link
Contributor Author

karrui commented Jul 31, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @karrui and the rest of your teammates on Graphite Graphite

@karrui karrui changed the title feat: slight change to base colors feat: replace hard-coded color values with CSS variables from site theme Jul 31, 2024
@karrui karrui changed the title feat: replace hard-coded color values with CSS variables from site theme feat: replace hard-coded color values with (hardcoded) CSS variables from site theme Jul 31, 2024
@karrui karrui marked this pull request as ready for review July 31, 2024 09:23
@karrui karrui requested a review from a team as a code owner July 31, 2024 09:23
so it can be consumed with a specific config.json
@karrui karrui merged commit 4f1290b into main Jul 31, 2024
19 checks passed
@karrui karrui deleted the karrui/isom-1287-themed-semantic-colour-tokens branch July 31, 2024 10:29
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