-
Notifications
You must be signed in to change notification settings - Fork 566
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
CSS variables with light-dark()? #1377
Comments
Might be possible if #1063 feature gets added, but as of now it's not possible |
Just a question: How do you respect the active theme chosen by the user with |
This article explains it in depth: https://css-tricks.com/come-to-the-light-dark-side/ Basically, set a meta color-scheme tag with value of dark, light or light dark (auto/user preference). Then maybe give them a setting to choose between those 3 options. I ended up writing a custom node script to parse the token JSON into light dark syntax rather than use style dictionary. |
👍🏻 About the issue, I had the same, and we write a custom transform that parses specific key names to return Something like this: {
"global-background": {
"$type": "color-theme",
"light": "#fff",
"dark": "#000"
}
} so our transform generates |
Having a light and a dark theme, is it possible to generate variables using the CSS
light-dark()
syntax?Ex desired output:
If yes, how would we need to structure the tokens JSON files? Using Tokens Studio for Figma, how could we get there?
The text was updated successfully, but these errors were encountered: