Skip to content

Trailing ) interferes with candidate extraction from Clojure/Script keywords #18344

Closed
@eneroth

Description

@eneroth
Contributor

What version of Tailwind CSS are you using?

v4.1.10

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

postcss-cli 11.0.1

What version of Node.js are you using?

v24.2.0

What browser are you using?

Chrome, Safari, Firefox

What operating system are you using?

macOS

Reproduction URL

No reproduction URL for this one.

Describe your issue

In Clojure, it seems that surrounding brackets interfere with the extraction of classes from keywords. E.g.:

(when condition :bg-white :bg-black)

The presence of ) at the end seems to prevent :bg-black from being captured. I have a suggestion for how to fix this in the pre-processor, but I'm afraid that my limited experience of Rust will show, so I will kindly ask for your good input on the matter.

Activity

IsmeetKachhap007

IsmeetKachhap007 commented on Jun 19, 2025

@IsmeetKachhap007

The root cause is that Tailwind’s scanner expects class names as plain strings, not as Clojure keywords or in bracketed/newline-separated forms. The most reliable solution is to always use strings for class names in your Clojure code and, if needed, implement a custom extractor or safelist for edge cases. If you want to contribute a fix or improve the extractor, you can look into writing a custom regex or extractor in your Tailwind config.

eneroth

eneroth commented on Jun 19, 2025

@eneroth
ContributorAuthor

Using keywords for classes is quite common in Clojure, and it's a tall order to ask all of those codebases to change, and people to change their habits. Other than that, Clojure syntax is complete, and will never change. V4 currently supports a subset of Clojure syntax, and there are just a couple of things to iron out, so IMO it makes sense to bring that up to 100% and then it's done, permanently.

added a commit that references this issue on Jun 30, 2025
05b65d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @eneroth@IsmeetKachhap007

      Issue actions

        Trailing `)` interferes with candidate extraction from Clojure/Script keywords · Issue #18344 · tailwindlabs/tailwindcss