Skip to content

Some classes not being detected in source files with square brackets #16750

@caleb

Description

@caleb

Versions:

@tailwindcss/cli: 4.0.8
tailwindcss: 4.0.8

Build tool: None
Node Version: v23.7.0
Browser: N/A
OS: macOS (15.3.1)
Reproduction URL: https://github.com/caleb/tailwindcss4bug

Issue
Tailwind is not dectecting a class when it's in a source file with a specific layout.

Let's say we have a component that has this code:

["h-[calc(100vh-(var(--spacing)*8)-(var(--spacing)*14))]",
 true],

Tailwind 4 will not detect the height class (version 3 did), and it won't include it in the output css file.

If we have either of these other layouts, then it does detect the class and generates the appropriate CSS:

["h-[calc(100vh-(var(--spacing)*8)-(var(--spacing)*14))]", true],
[ "h-[calc(100vh-(var(--spacing)*8)-(var(--spacing)*14))]",
 true],

Metadata

Metadata

Assignees

No one assigned

    Labels

    oxideIssues affecting file parsing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions