-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Generate additive tokens with rgb value outputs #30
Comments
Hey @jkinley, firstly, hex values do work with opacity, the format is called
Hope that helps. |
Yes. I am aware of hex8, but that does not help us get the RGB values that we need for Bootstrap. We will look into your other suggestions. Thanks! |
Great use-case! This brings us to the potential need for a token object model (aka TOM), which isn't easy to codify, but I'll post this here so I can both plant the seed and subscribe to this thread. |
HI Lukas. I have a question on how we might go about doing something and think it could be of value to your repo.
So (sadly) we are supporting a Bootstrap theme and need some of our tokens to line-up with Bootstrap CSS Vars. One of the things they do is create CSS vars like this:
But because the hex values don't handle opacity, they also generate RGB values from these hex values, like so:
So how do we go about handling this with Style Dictionary? My colleague Doug has worked out a custom transformer, but we still have some questions.
We only need this for a handful of the color tokens. We don't want to generate these RGB values for 100's of tokens. More like a dozen or so, but it would be nice to automate to reduce maintenance and errors.
Is there a way to 'handpick' or label specific tokens to be processed so that we retain the hex token but also output the RGB values for it as well?
Given that the W3C spec wants colors defined in Hex and they suggest conversion to other color spaces, how do you think is the best way to approach this?
The text was updated successfully, but these errors were encountered: