-
Notifications
You must be signed in to change notification settings - Fork 30
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
cross-file token/token-group collision #275
Comments
Could you try to reproduce it in the configurator? I also tried to reproduce it in an integration test in sd-transforms itself and there I also get the desired output |
Thanks kindly for your diligence @jorenbroekema I tested based on your reproduction a bit and was scratching my head trying to replicate the issue for a minute there, however I have successfully reproduced the issue It appears everything resolves correctly until I split the resolved colours off into a seperate .json, which then causes the math resolve to fail. The logic here is that in this design system, resolved colours (represented in Is there some additional handling I'm neglecting to achieve this pattern? |
I think I know what the problem is, loading all the input files for style-dictionary, it merges everything into a single dictionary structure. {
foo: {
bar: {
value: ...
}
}
} merged with: {
foo: {
value: ...
}
} Is essentially what you're doing in that reproduction, merging a |
Might be good for style-dictionary to warn about these kinds of collisions, or even throw an error, because this seems to me to be always fatal and a user error |
What happened?
My design system derives the majority of it's colours from a single primary hue and generates a theme around that using lch colour space. All luminosity, chroma, and hue values are split up atomically like so:
...the arithmetic in hue uses a mix property for users to adjust how distinct or similar the derived colours are from the seed colour.
They are then combined into actual colours like:
..however when I build with
ts/resolveMath
, whilst math is resolved as expected in other tokens, these lch colour tokens are output as ie--clr-secondary: lch(72%, 14, 298 + 120 * -1);
Reproduction
Expected output
--clr-secondary: lch(72%, 14, 298 + 120 * -1);
should be ->--clr-secondary: lch(72%, 14, 178);
...this is rendered correctly in figma, but doesn't seem to be able to transform correctly for style-dictionary.
Version
0.15.2
The text was updated successfully, but these errors were encountered: