Skip to content

Commit 0cedbe2

Browse files
committed
Optimize AST before printing for IntelliSense
1 parent 3d0b86c commit 0cedbe2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/tailwindcss/src/design-system.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { toCss } from './ast'
1+
import { optimizeAst, toCss } from './ast'
22
import { parseCandidate, parseVariant, type Candidate, type Variant } from './candidate'
33
import { compileAstNodes, compileCandidates } from './compile'
44
import { getClassList, getVariants, type ClassEntry, type VariantEntry } from './intellisense'
@@ -60,11 +60,13 @@ export function buildDesignSystem(theme: Theme): DesignSystem {
6060
let wasInvalid = false
6161

6262
let { astNodes } = compileCandidates([className], this, {
63-
onInvalidCandidate(candidate) {
63+
onInvalidCandidate() {
6464
wasInvalid = true
6565
},
6666
})
6767

68+
astNodes = optimizeAst(astNodes)
69+
6870
if (astNodes.length === 0 || wasInvalid) {
6971
result.push(null)
7072
} else {

0 commit comments

Comments
 (0)