Skip to content

leading-loose unable to override line-height from xl:text-6xl due css definition order #6504

@bithavoc

Description

@bithavoc

What version of Tailwind CSS are you using?

3.0.2

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

What version of Node.js are you using?

  • Node v14.16.1

What browser are you using?

Chrome, Firefox

What operating system are you using?

macOS and Windows

Reproduction URL

https://github.com/widemeshio/bug-tailwind-v3-leading-vs-text-height

Describe your issue

In a brand new Next.js project(or also legacy using v3 and gulp with postcss),
leading-loose css classes are generated before screen size variants(md, xl, etc) so because what matters is the order in which the css classes are defined not in the order they're used in class="", its currently not possible to do something like lg:text-6xl leading-loose because lg:text-6xl's line-height takes priority. text-6xl leading-loose works though, so this is specific about screen size variants.

Example code:

     <main className="w-1/4">
        <h3 className="text-6xl leading-loose text-green-600">
          text-6xl + leading (OK)
        </h3>
        <h3 className="lg:text-6xl leading-loose text-red-600">
          lx:text-6xl + leading (Buggy)
        </h3>
      </main>

Inspector:

image

Page View:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions