reduct code smells
This commit is contained in:
parent
ed71ee438d
commit
55f3f93f91
1 changed files with 9 additions and 6 deletions
|
|
@ -38,16 +38,19 @@ export default function(config) {
|
|||
return
|
||||
}
|
||||
|
||||
let includesScreenUtilitiesExplicitly = false
|
||||
const includesScreensExplicitly = css.some(
|
||||
rule => rule.type === 'atrule' && rule.params === 'screens'
|
||||
)
|
||||
|
||||
if (!includesScreensExplicitly) {
|
||||
css.append(finalRules)
|
||||
return
|
||||
}
|
||||
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params === 'screens') {
|
||||
includesScreenUtilitiesExplicitly = true
|
||||
atRule.replaceWith(finalRules)
|
||||
}
|
||||
})
|
||||
|
||||
if (!includesScreenUtilitiesExplicitly) {
|
||||
css.append(finalRules)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue