tokens-studio / sd-transforms

Custom transforms for Style-Dictionary, to work with Design Tokens that are exported from Tokens Studio
MIT License
198 stars 29 forks source link

[Bug]: Expanded lineheight tokens have wrong type. #310

Closed wannesdebacker closed 1 month ago

wannesdebacker commented 2 months ago

What happened?

I encountered an issue where the lineHeight type is unexpectedly converted to a string instead of a number when using the ts/size/lineheight transform in conjunction with expanded typography tokens.

It seems that the lineHeight transform is being applied before the expansion process. This might be causing the lineHeight value to first convert to a string during the transformation (e.g., "600 12px/1.335 Arial") and then pass through the expansion process, which retains the incorrect string format. (could be totally wrong on this).

sd-transforms version 1.2.3. style-dictionary 4.0.1

Reproduction

configurator

Expected output

That line-height is an Number everywhere.

Version

1.2.3

jorenbroekema commented 2 months ago

Yeah this definitely seems like a bug. Will need to investigate, I don't see from a first glance why this would happen and I'm a bit suspicious it might be related to the JS format rather than the transforms

jorenbroekema commented 1 month ago

I was wrong, it was indeed related to our lineHeight transform 😅 fixed in next release (1.2.4)!