Thanks to visit codestin.com
Credit goes to github.com

Skip to content

supports variant compiles function syntax incorrectly #13594

@adamwathan

Description

@adamwathan

What version of Tailwind CSS are you using?

v3 and v4

Reproduction URL

https://play.tailwindcss.com/ySYgzSn5FT

Describe your issue

Classes like supports-[font-format(opentype)]:grid generate invalid CSS, because we currently assume that supports values that don't contain : are a CSS property and we insert a variable at the end in an attempt to make the query valid:

@supports (font-format(opentype): var(--tw)) {
  .supports-\[font-format\(opentype\)\]\:grid {
    display: grid;
  }
}

This isn't a crazy complicated thing to fix but there are a number of test cases to consider:

supports-[font-format(opentype)]:grid
supports-[content:"("]:grid
supports-[(display:grid)_and_font-format(opentype)]:grid

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