[Bug]: missed lowercasing of font style "alone" in font weight tokens #267
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
What happened?
When I generate Sass variables based on font weight tokens coming from Figma, I get for example this:
The two last variables have
italic
as lowercase, but$font-weight-400-italic
has a capital inItalic
.I think it's because there is no actual weight number in front of this font style.
The regex here allows it: https://github.com/tokens-studio/sd-transforms/blob/main/src/transformFontWeights.ts#L35-L38
But the conversion of font style here is "inside" the one for the font weight value, so if there is no font weight value, the font style is not converted: https://github.com/tokens-studio/sd-transforms/blob/main/src/transformFontWeights.ts#L55-L57
I guess the
if (match.groups.style)
should be outside theif (match?.groups?.weight)
.I can make a PR if this is the correct fix.
Reproduction
No response
Expected output
No response
Version
0.14.4
The text was updated successfully, but these errors were encountered: