Skip to content

Commit 3a976a6

Browse files
committed
Allow @tailwind screens directive inside an at-rule
1 parent efc0488 commit 3a976a6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib/substituteResponsiveAtRules.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ export default function(config) {
3434
})
3535

3636
const hasScreenRules = finalRules.some(i => i.nodes.length !== 0)
37+
3738
if (!hasScreenRules) {
3839
return
3940
}
4041

41-
const includesScreensExplicitly = css.some(
42-
rule => rule.type === 'atrule' && rule.params === 'screens'
43-
)
44-
45-
if (!includesScreensExplicitly) {
46-
css.append(finalRules)
47-
return
48-
}
42+
let includesScreensExplicitly = false
4943

5044
css.walkAtRules('tailwind', atRule => {
5145
if (atRule.params === 'screens') {
5246
atRule.replaceWith(finalRules)
47+
includesScreensExplicitly = true
5348
}
5449
})
50+
51+
if (!includesScreensExplicitly) {
52+
css.append(finalRules)
53+
return
54+
}
5555
}
5656
}

0 commit comments

Comments
 (0)