Skip to content

[4.1.4]If I only use the text-xl in class name, seem the --tw-leading will be not defined #17704

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

Closed
AmelloAster opened this issue Apr 17, 2025 · 5 comments

Comments

@AmelloAster
Copy link

What version of Tailwind CSS are you using?
v4.1.4

What build tool (or framework if it abstracts the build tool) are you using?

ReactV18 webpackV5

What version of Node.js are you using?

v20.0.0

What browser are you using?

Chrome, Safari

What operating system are you using?

macOS

Describe your issue

Image

@micobarac
Copy link

I can confirm the same.

@wongjn
Copy link
Collaborator

wongjn commented Apr 17, 2025

I believe that is intended behavior. The CSS variable is there for composability with leading-* classes. The browser uses the fallback value if the CSS variable is not defined.

@AmelloAster
Copy link
Author

I believe that is intended behavior. The CSS variable is there for composability with leading-* classes. The browser uses the fallback value if the CSS variable is not defined.

I see, if tw-leading is not defined, the line-height in text-2xl is actually quite invalid, and it will default to the line-height that comes with html, so why generate this invalid line-height? Is it a kind of redundancy?

@wongjn
Copy link
Collaborator

wongjn commented Apr 17, 2025

the line-height in text-2xl is actually quite invalid and it will default to the line-height that comes with html

It shouldn't be invalid with default configuration. As per this Tailwind Play, it should be calc(2 / 1.5) which evaluates to 1.333… which is a valid line-height value:

Image

@AmelloAster
Copy link
Author

the line-height in text-2xl is actually quite invalid and it will default to the line-height that comes with html

It shouldn't be invalid with default configuration. As per this Tailwind Play, it should be calc(2 / 1.5) which evaluates to 1.333… which is a alid line-height value:

Image

oh, I got it, thanks

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

3 participants