-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
What version of Tailwind CSS are you using?
v2.2.4
What build tool (or framework if it abstracts the build tool) are you using?
Tailwind CLI
What version of Node.js are you using?
v16.2.0
What browser are you using?
Firefox (v89.0.2)
What operating system are you using?
macOS (11.4)
Reproduction repository
https://github.com/bakerkretzmar/tailwindcss-jit-quotes-repro
Describe your issue
If an arbitrary value in a class name is immediately followed by a single quote mark and another closing bracket, the quote and bracket are included in the generated class name.
For example, this markup:
<h1 class="<?php echo wrap(['class' => 'max-w-[16rem]']); ?>">Hello world</h1>generates this CSS:
.max-w-\[16rem\]\'\] {
max-width: 16rem]'
}The string ['class' => 'max-w-[16rem]'] seems to be the issue, specifically the fact that it ends with ]']. It looks like the JIT engine stops at the second ], interpreting the arbitrary value for the CSS property to be 16rem]'.
Adding a space before those characters (['class' => 'max-w-[16rem] ']) 'fixes' the issue and produces valid CSS.
Metadata
Metadata
Assignees
Labels
No labels