-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Only detect nesting when using @apply
#13325
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
Changes from 3 commits
778a8f4
87338ed
ce0ec5a
88845bf
5f6a8ed
8dded23
f276cff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -432,6 +432,23 @@ function processApply(root, context, localCache) { | |
|
|
||
| let rules = applyClassCache.get(applyCandidate) | ||
|
|
||
| // Verify that we can apply the class | ||
| for (let [, rule] of rules) { | ||
| if (rule.type === 'atrule') { | ||
| continue | ||
| } | ||
|
|
||
| rule.walkRules(() => { | ||
| throw apply.error( | ||
| [ | ||
| `The \`${applyCandidate}\` class cannot be applied because it uses nested CSS.`, | ||
|
||
| 'Please enable a CSS nesting plugin *before* Tailwind in your configuration.', | ||
| 'See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting', | ||
|
||
| ].join('\n') | ||
| ) | ||
| }) | ||
| } | ||
RobinMalfait marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| candidates.push([applyCandidate, important, rules]) | ||
| } | ||
| } | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used an
errorinstead of awarninglike we used to do for 2 reasons:error.