You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue transforming a color token and wondered if anyone else has seen this or have any tips on how to solve it. I'll simplify and remove unnecessary parts of my setup for brevity but hopefully it's detailed enough for you to understand what's going on.
FYI - I'm not responsible for the token structure, only transforming them via Style Dictionary so please let me know if the structure is the problem. Also, if it's relevant.. we're using Tokens Studio via Figma to generate these.
Looking at the logs, I can see that Black 100 gets converted fine and other tokens that reference this work as expected. However, when nav-gradient is put through customColor, the matcher is returning true as expected but it's not being passed to the transformer. I suspect this is because the value being passed in malformed e.g. linear-gradient(0deg, 0xff000000 0%, 0xff000000 100%) and doesn't know what to do with it. I have other linear-gradients in my token files that work fine, but those don't use references.
Is there anything I can do to solve this?
The text was updated successfully, but these errors were encountered:
The reason wwhy your nav-gradient token is not being transformed is because it contains a token reference/alias ({Palette.Black.Black 100}. By default, transforms do not transform tokens with references in its value.
However, in your example I don't really think a transitive transform is gonna work, because I'm going to assume that your toArgb function is not going to be able to understand CSS linear-gradient syntax?
Maybe for me to understand your use case better, can you show me what your output CSS is and what your expected or desired output is versus that?
Hello!
I'm having an issue transforming a color token and wondered if anyone else has seen this or have any tips on how to solve it. I'll simplify and remove unnecessary parts of my setup for brevity but hopefully it's detailed enough for you to understand what's going on.
FYI - I'm not responsible for the token structure, only transforming them via Style Dictionary so please let me know if the structure is the problem. Also, if it's relevant.. we're using Tokens Studio via Figma to generate these.
I have setup a custom color transform as our target platform requires ARGB values.
Looking at the logs, I can see that
Black 100
gets converted fine and other tokens that reference this work as expected. However, whennav-gradient
is put throughcustomColor
, the matcher is returningtrue
as expected but it's not being passed to the transformer. I suspect this is because the value being passed in malformed e.g.linear-gradient(0deg, 0xff000000 0%, 0xff000000 100%)
and doesn't know what to do with it. I have other linear-gradients in my token files that work fine, but those don't use references.Is there anything I can do to solve this?
The text was updated successfully, but these errors were encountered: