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

2.0 Adds line-heights to font-size utilities by default which overtakes .leading-tight in specify #2808

Closed
ghost opened this issue Nov 19, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2020

introduced by 7d10259

When doing

h1 {
  @apply leading-tight text-5xl;
}

The outcome is

@media (min-width: 1024px)
.lg\:text-5xl {
    font-size: 3rem;
    line-height: 1;
}

Overtakes

h1 {
    font-size: 3rem;
    line-height: 1;
    line-height: 1.25;
}

in specify
IE:
DevTools_-_localhost_4001_

Also Just noticing the other odd-looking line-height: 1; on h1.

@ghost ghost changed the title 2.0 adds line-height: 1; to .lg\:text-5xl overtakes .leading-tight in specify 2.0 adds line-height: 1 to text-5xl which overtakes .leading-tight in specify Nov 19, 2020
@ghost ghost changed the title 2.0 adds line-height: 1 to text-5xl which overtakes .leading-tight in specify 2.0 Add line-heights to font-size utilities by default which overtakes .leading-tight in specify Nov 19, 2020
@ghost ghost changed the title 2.0 Add line-heights to font-size utilities by default which overtakes .leading-tight in specify 2.0 Adds line-heights to font-size utilities by default which overtakes .leading-tight in specify Nov 19, 2020
@adamwathan
Copy link
Member

Can you share your HTML as well? It looks like maybe you are doing this:

<h1 class="lg:text-5xl">Hello</h1>

If so, then what you are seeing is by design, adding lg:text-5xl will override the line-height. You can add lg:leading-tight to override the default.

@ndrsllwngr
Copy link

ndrsllwngr commented Nov 19, 2020

I experienced the same issue.

I would expect that leading-tight (line-height: 1.25) would take precedence for all viewports (incl. md and up) over the line-height set by text-4xl md:text-7xl. But having viewport >= md leading-tight gets overwritten.

@ghost
Copy link
Author

ghost commented Nov 19, 2020

If providing the viewport provides greater specificity and that is by design then I'm ok with that.
Closing as by design. Thanks for the clarification lg:leading-tight works for me.

@ghost ghost closed this as completed Nov 19, 2020
@howdu
Copy link

howdu commented Oct 8, 2022

Future viewers who land here... you can now remove the line-height see: #6504 (comment)

This issue was closed.
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