Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mschoeffmann opened this issue Jun 9, 2022 · 1 comment · Fixed by #8558
Closed
Assignees

Comments

@mschoeffmann
Copy link

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?

@RobinMalfait
Copy link
Contributor

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed by #8588, and will be available in the next release.

You can already try it by using the insiders build npm install tailwindcss@insiders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants