-
Notifications
You must be signed in to change notification settings - Fork 545
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
outputReferencesTransformed resolves opacity variable in RGBA #1201
Comments
Yes I can explain why it happens and unfortunately no, this cannot be fixed/worked around. Let's take a look at the token value: It is then transformed by The token value has been transitively transformed, and fundamentally speaking a token cannot be a reference to another token in the output, while also being a transformed version of itself simultaneously, it's "either, or". So what the Style Dictionary v3 was eagerly outputting references, and while it didn't cause a problem in your specific scenario, it was very prone to nasty and hard to explain bugs. Related issues: I would have liked to work on this topic more for v4 but I was running out of the time and the release is already huge, I'm hoping to revisit this topic in more detail for a future v5 but there is no timeline for that yet, definitely not for another 6-12 months I'd say. |
I think it makes sense to create an issue:
It's pretty late right now and I don't have my early morning brainpower but while writing this it made me go "but can we make it smart enough to determine this per reference in a token, rather than on the token as a whole", and I think that is worth exploring for sure, this may be a non-breaking enhancement to the v4 later down the line. |
In
v4
the value as followsis transformed to something like
But on
v3
it was transformed toNote the opacity variable is resolved on
v4
and it is preserved onv3
Here is the code of my setup:
token:
And the config:
Could you suggest how to make configure
v4
so it stops resolvingopacity
variables in anrgba
function? That is instead of--overlay: rgba(51, 51, 51, 0.7)
I would likev4
to generate--overlay: rgba(51, 51, 51, var(--overlay-value));
as it was onv3
.The text was updated successfully, but these errors were encountered: