-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Only detect nesting when using @apply
#13325
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.`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a new message, so we can definitely change some wording here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe something like:
|
||
'Please enable a CSS nesting plugin *before* Tailwind in your configuration.', | ||
'See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part is coming from the original There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can drop this part with the change above I think. |
||
].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
error
instead of awarning
like we used to do for 2 reasons:error
.