Closed mikeriley131 closed 3 months ago
Can you share a reproduction? I can't seem to reproduce this. Are you using the CSS transformGroup or the tokens-studio transformGroup?
I suspect you're using the tokens-studio transformGroup which contains the ts/resolveMath
transform which rounds stuff to 4 digits by default, but you can configure it like so:
{
platforms: {
css: {
"mathFractionDigits": 5,
"transformGroup": "tokens-studio",
"files": [
{
"format": "css/variables",
"destination": "output.css"
}
]
}
}
}
https://github.com/tokens-studio/sd-transforms?tab=readme-ov-file#tsresolvemath
Btw, try using the latest sd-transforms, the default value for mathFractionDigits is 4 there already so you might not need to configure anything if you use the latest.
Thanks @jorenbroekema. I updated to v1.2.1 of @tokens-studio/sd-transforms and I now have 4 digit fractions in my outputted tokens.
I've looked through the docs and could not find any config or transform related to the rounding of decimals. My design tokens for font-size sometimes use four decimal places (ex:
0.9375rem
) and I am finding that they are being rounded to three decimals places (0.938rem
). Is there a way to configure the rounding of these?style-dictionary: v4.0.1 @tokens-studio/sd-transform: v1.0.1