-
Notifications
You must be signed in to change notification settings - Fork 839
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
Extract SCSS variables for use in JS #2731
Comments
@chandlerprall I would like to give it a try, please assign me. |
@lokeshrana9999 go ahead; this one has some extra considerations though, as our build output does not go through webpack (where these type of transformations usually happen). Instead, we have babel convert the source files into their target directories. We'd need another tool to similarly process SCSS into JS files with those variables. |
@ryankeairns I am working on an implementation of this issue. If you could point me to a specific use case, I might get a better idea of what is to be expected. |
@lokeshrana9999 a use case would be to import the |
I'll also add to that that this would be in the EUI component creation |
Thanks @chandlerprall and @cchaos, I'll keepit in mind. |
Hii @chandlerprall I still have a query regarding this that needs to be resolved. If the application of scss variables is in docs ie src-docs then webpack along with scss-loader allows direct import of variables. Else if the application is during consuming the library this line |
Yes, the ask here is that files in
but we cannot use either of those methods to import a value from a component itself |
Understood, will get to it. |
Any progress, thoughts, or questions @lokeshrana9999 ? Just checking in - it's certainly a harder issue to tackle :) |
@chandlerprall I am trying to implement conditional import of variables based on the environment, while in build consumable colors can be used and during development imports with the help of webpack, I have implemented both conditions saperately but I am trying to figure out if NODE_ENV |
Since making the decision to move forward with a CSS-in-JS solution (#3912), any work related color variables, etc. will be part of a broader theming effort. Closing this in favor of discussion the linked issue. |
With all the work going on around colors, there is a growing need to access EUI colors programmatically via JavaScript. Currently, all of our hex colors are defined as global SCSS variables, so it would be nice to extract those into a set of color palette arrays.
This would allow us to import and use them in things like chroma color functions, etc.
Related issue: #2611 - there is some overlapping functionality here perhaps, although this issue is tied into theming.
The text was updated successfully, but these errors were encountered: