Skip to content

3.1.0 - classes not included when using EJS conditions in class="" without spaces #8553

@mschoeffmann

Description

@mschoeffmann

What version of Tailwind CSS are you using?

v3.1.0 (was working in v3.0.24)

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

webpack v4.46.0, postcss-loader v4.3.0

What version of Node.js are you using?

v16.15.1

What browser are you using?

Chrome (102.0), Safari (15.5)

What operating system are you using?

macOS 12.4

Reproduction URL

https://play.tailwindcss.com/tc5Nfn0F00

See generated CSS. It should include definitions for shadow-lg AND shadow-xl.
But since v3.1.0, the shadow-xl is ignored.

Describe your issue

In v3.0.24 it was possible, to use EJS conditions in a class=""attribute like:
<div class="bg-blue-200 <% if (useShadow) { %>shadow-xl<% } %>">test</div>

In v3.1.0 this is not possible any more. Classes are only detected if there is a space before and after the class name:
<div class="bg-blue-200 <% if (useShadow) { %> shadow-lg <% } %>">test</div>

Maybe parsing is not treating < and > as whitespaces to separate classes any more?

Metadata

Metadata

Assignees

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