Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
)
from interfering with extraction in Clojure keywords #18345IsmeetKachhap007 commentedon Jun 19, 2025
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 commentedon Jun 19, 2025
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.
Fix trailing `)` from interfering with extraction in Clojure keywords (…