Urara-Blog/node_modules/.pnpm-store/v3/files/7a/9eae4329c54bb2837fb7833b4fcc0610031023fec91e8a5047e902cbef84f2553e8a7214b76f3d8cb45130e5f7256bc877dc7f67d50c479a717e34f3e0def2
2022-08-14 01:14:53 +08:00

39 lines
1.2 KiB
Text

export default function (_context) {
return (root, result) => {
let found = false
root.walkAtRules('tailwind', (node) => {
if (found) return false
if (node.parent && node.parent.type !== 'root') {
found = true
node.warn(
result,
[
'Nested @tailwind rules were detected, but are not supported.',
"Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix",
'Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy',
].join('\n')
)
return false
}
})
root.walkRules((rule) => {
if (found) return false
rule.walkRules((nestedRule) => {
found = true
nestedRule.warn(
result,
[
'Nested CSS was detected, but CSS nesting has not been configured correctly.',
'Please enable a CSS nesting plugin *before* Tailwind in your configuration.',
'See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting',
].join('\n')
)
return false
})
})
}
}