Skip to content

Media query is not working for all browsers not just Safari #17385

@benjaminv

Description

@benjaminv

What version of Tailwind CSS are you using?

example: v4.0.16

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

Vite 6.2.0

What version of Node.js are you using?

v20.0.0

What browser are you using?

Chrome, Safari, and Firefox

What operating system are you using?

macOS, iOS

Describe your issue

This applies to both Dev and final build.
The css is translated to

@layer utilities {
.lg\:bg-blue-300 {
    @media (width >= '990px') {
      background-color: var(--color-blue-300);
    }
  }
}

Where it should be

@layer utilities {
.lg\:bg-blue-300 {
    @media (width >=  900px) { /* should not have quote in size */
      background-color: var(--color-blue-300);
    }
  }
}

or more conveniently,

@layer utilities {
.lg\:bg-blue-300 {
    @media (min-width:900px) {
      background-color: var(--color-blue-300);
    }
  }
}

the difference is currently @media (width >= '990px') with '' on size is not working, otherwise @media (width >= 900px) works.

According to MWD reference the size value should not have quote.

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