IF the line height is unitless, then do not do any convertion.
IF the line height is not unitless then ensure that the configuration option fontSizeFormat is used for converting the measurement like shown here.
IF fontSizeFormat is not set, then do not do any convertion.
IF the letter spacing is not the same unit as the configuration option fontSizeFormat then convert the measurement like shown here.
👋
We are currently going through accessibility testing and have identified that
line-height
s are exported inpx
regardless of thefontSizeFormat
option.My suggestion is as follows;
Line height:
https://github.com/Specifyapp/parsers/blob/00b3e41aa7b9e8fe9663b7978fd9d69d4c96a3c9/parsers/to-tailwind/tokens/textStyle.ts#L23-L24
IF the line height is unitless, then do not do any convertion. IF the line height is not unitless then ensure that the configuration option
fontSizeFormat
is used for converting the measurement like shown here.https://github.com/Specifyapp/parsers/blob/00b3e41aa7b9e8fe9663b7978fd9d69d4c96a3c9/parsers/to-tailwind/tokens/textStyle.ts#L43-L46
Letter spacing:
https://github.com/Specifyapp/parsers/blob/00b3e41aa7b9e8fe9663b7978fd9d69d4c96a3c9/parsers/to-tailwind/tokens/textStyle.ts#L19-L20
IF
fontSizeFormat
is not set, then do not do any convertion. IF the letter spacing is not the same unit as the configuration optionfontSizeFormat
then convert the measurement like shown here.https://github.com/Specifyapp/parsers/blob/00b3e41aa7b9e8fe9663b7978fd9d69d4c96a3c9/parsers/to-tailwind/tokens/textStyle.ts#L43-L46