Skip to content

[v4] Angular conditional class not recognized by tailwind #15740

@Eirmas

Description

@Eirmas

What version of Tailwind CSS are you using?

v4.0.0

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

Angular v19.1

What version of Node.js are you using?

v23.5.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

I made a small repository showcasing the bug: https://github.com/Eirmas/tailwind-4-bug

Describe your issue

Angular allows for adding conditional classes with the following syntax:

<div [class.pt-4]="bool"></div>

It seems that Tailwind doesn't see the pt-4 class being used here, and therefore doesn't add it to the stylesheet.

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