-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Leveraging CSS Variables in JavaScript Configurations #56
Comments
@douglaszaltron why did you close this? |
I clicked by mistake.🤦♂️ |
Wait, why do we need Can't we compile css in one step and in js we assume the css exists? Or are you saying you want to be able to have a different prefix for css and js or no prefix for js? |
In the case of js not having a prefix and css having one, it is more common for css to have the prefix. Example |
Hey @douglaszaltron, sorry, I just noted that I completely misread this PR. So what this does is it replaces the value of a token with it's own name as a css variable. E.g. danger.$value: {base.red} would be turned into danger: var(--base-red). So do you want to target the reference or are you really looking for replacing a variables value with it's own name. |
Closed due to inactivity |
An intriguing approach in web development involves harnessing CSS variables within JavaScript files by transforming values to utilize CSS variables in JSON and JavaScript files. This technique is particularly handy when we aim to utilize CSS variables that are globally defined within JavaScript files.
For instance, when creating a preset for Tailwind CSS, I generate the JavaScript configurations for the theme. However, I desire to employ the CSS variables seamlessly within these configurations. This integration not only streamlines development but also enhances the flexibility and maintainability of the codebase, facilitating smoother collaboration and iteration.
The text was updated successfully, but these errors were encountered: