Allow @tailwind screens directive inside an at-rule
This commit is contained in:
parent
efc04881a3
commit
3a976a60d7
1 changed files with 9 additions and 9 deletions
|
|
@ -34,23 +34,23 @@ export default function(config) {
|
|||
})
|
||||
|
||||
const hasScreenRules = finalRules.some(i => i.nodes.length !== 0)
|
||||
|
||||
if (!hasScreenRules) {
|
||||
return
|
||||
}
|
||||
|
||||
const includesScreensExplicitly = css.some(
|
||||
rule => rule.type === 'atrule' && rule.params === 'screens'
|
||||
)
|
||||
let includesScreensExplicitly = false
|
||||
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params === 'screens') {
|
||||
atRule.replaceWith(finalRules)
|
||||
includesScreensExplicitly = true
|
||||
}
|
||||
})
|
||||
|
||||
if (!includesScreensExplicitly) {
|
||||
css.append(finalRules)
|
||||
return
|
||||
}
|
||||
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params === 'screens') {
|
||||
atRule.replaceWith(finalRules)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue