Skip to content

Commit aa4f13a

Browse files
committed
only handle at-rules
1 parent b8a8e31 commit aa4f13a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/tailwindcss/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ async function parseCss(
7676

7777
await substituteAtImports(ast, base, loadStylesheet)
7878

79-
// Find all `@theme` declarations
8079
let important: boolean | null = null
8180
let theme = new Theme()
8281
let customVariants: ((designSystem: DesignSystem) => void)[] = []
8382
let customUtilities: ((designSystem: DesignSystem) => void)[] = []
8483
let firstThemeRule: Rule | null = null
8584
let globs: { base: string; pattern: string }[] = []
8685

86+
// Handle at-rules
8787
walk(ast, (node, { parent, replaceWith, context }) => {
8888
if (node.kind !== 'rule') return
89+
if (node.selector[0] !== '@') return
8990

9091
// Collect custom `@utility` at-rules
9192
if (node.selector.startsWith('@utility ')) {
@@ -196,7 +197,7 @@ async function parseCss(
196197
}
197198
}
198199

199-
if (node.selector[0] === '@' && node.selector.startsWith('@media ')) {
200+
if (node.selector.startsWith('@media ')) {
200201
let params = segment(node.selector.slice(7), ' ')
201202
let unknownParams: string[] = []
202203

0 commit comments

Comments
 (0)