File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -667,15 +667,13 @@ export async function compileAst(
667
667
}
668
668
669
669
let didChange = false
670
- let emitNewCssVariables = false
671
670
672
671
// Add all new candidates unless we know that they are invalid.
673
672
let prevSize = allValidCandidates . size
674
673
for ( let candidate of newRawCandidates ) {
675
674
if ( ! designSystem . invalidCandidates . has ( candidate ) ) {
676
675
if ( candidate [ 0 ] === '-' && candidate [ 1 ] === '-' ) {
677
- emitNewCssVariables = designSystem . theme . markUsedVariable ( candidate )
678
- didChange ||= emitNewCssVariables
676
+ designSystem . theme . markUsedVariable ( candidate )
679
677
} else {
680
678
allValidCandidates . add ( candidate )
681
679
}
@@ -697,7 +695,7 @@ export async function compileAst(
697
695
// If no new ast nodes were generated, then we can return the original
698
696
// CSS. This currently assumes that we only add new ast nodes and never
699
697
// remove any.
700
- if ( previousAstNodeCount === newNodes . length && ! emitNewCssVariables ) {
698
+ if ( previousAstNodeCount === newNodes . length ) {
701
699
compiled ??= optimizeAst ( ast , designSystem )
702
700
return compiled
703
701
}
Original file line number Diff line number Diff line change @@ -185,11 +185,10 @@ export class Theme {
185
185
markUsedVariable ( themeKey : string ) {
186
186
let key = unescape ( this . #unprefixKey( themeKey ) )
187
187
let value = this . values . get ( key )
188
- if ( ! value ) return false // Unknown variable
189
- if ( value . options & ThemeOptions . USED ) return false // Variable already used
188
+ if ( ! value ) return // Unknown variable
189
+ if ( value . options & ThemeOptions . USED ) return // Variable already used
190
190
191
191
value . options |= ThemeOptions . USED
192
- return true
193
192
}
194
193
195
194
resolve ( candidateValue : string | null , themeKeys : ThemeKey [ ] ) : string | null {
You can’t perform that action at this time.
0 commit comments