Skip to content
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

Incorrect tailwind line-height classes generated #125

Open
liampcollins opened this issue Oct 21, 2024 · 3 comments
Open

Incorrect tailwind line-height classes generated #125

liampcollins opened this issue Oct 21, 2024 · 3 comments

Comments

@liampcollins
Copy link

Hi,

It looks like there is an issue with the outputted tailwind line-height classes. We have a text layer in Figma with font-size 14px and line-height 24px. The outputted tailwind classes are text-sm which is correct, and leading-normal which is (1.5 x font-size) so gives us 21px which is incorrect.

Screenshot 2024-10-21 at 16 33 35 Screenshot 2024-10-21 at 16 35 04
@liampcollins
Copy link
Author

liampcollins commented Oct 21, 2024

I believe the tailwind named classes (like leading-normal) are relative to the font size rather than being rems so I think the font size may need to be passed through to here perhaps?

image

@bernaferrari
Copy link
Owner

AFAIK text-sm overrides leading (but maybe it is order dependent) but maybe I'm wrong. If you can find the exact issue I surely can fix :)

@liampcollins
Copy link
Author

Thanks for the response. Perhaps the order can make a difference but in the example I have it is using the leading class. I think the bug originates from an assumption in the code that leading-normal represents 1.5rem when in fact it is 1.5 x font-size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants