Skip to content

Conversation

@thecrypticace
Copy link
Contributor

When Tailwind CSS detects arbitrary values that use "dynamic-like" placeholders (e.g. h-[${sizes.height}]) we would still output the CSS. This would result in a rule like height: ${sizes.height} which is a syntax error. We were already doing a check to only output rules for arbitrary properties if they result in parsable CSS. I've refactored the code and added a check so we now do the same thing for any arbitrary value and will now skip generating utilities in this case.

As a reminder Tailwind CSS does not process your source code and does not generate utilities from dynamic classes which you can read more about here: https://tailwindcss.com/docs/content-configuration#dynamic-class-names

Fixes #7771

@thecrypticace thecrypticace merged commit 68d896b into master Mar 8, 2022
@thecrypticace thecrypticace deleted the fix/unparsable-arbitrary-values branch March 8, 2022 17:43
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 this pull request may close these issues.

JIT analysis the comments code to add that classes instead of omit it

2 participants