File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5478,7 +5478,7 @@ describe('feature detection', () => {
54785478 expect ( compiler . features & Features . Variants ) . toBeFalsy ( )
54795479 } )
54805480
5481- test ( '`@tailwind utilities` is discovered inside `@reference`' , async ( ) => {
5481+ test ( '`@tailwind utilities` is ignored inside `@reference`' , async ( ) => {
54825482 let compiler = await compile (
54835483 css `
54845484 @reference "tailwindcss/utilities" ;
@@ -5497,6 +5497,6 @@ describe('feature detection', () => {
54975497
54985498 // We see @tailwind utilities but because of @reference it is ignored
54995499 expect ( compiler . features & Features . AtImport ) . toBeTruthy ( )
5500- expect ( compiler . features & Features . Utilities ) . toBeTruthy ( )
5500+ expect ( compiler . features & Features . Utilities ) . toBeFalsy ( )
55015501 } )
55025502} )
Original file line number Diff line number Diff line change @@ -162,6 +162,14 @@ async function parseCss(
162162 return
163163 }
164164
165+ // When inside `@reference` we should treat `@tailwind utilities` as if
166+ // it wasn't there in the first place. This should also let `build()`
167+ // return the cached static AST.
168+ if ( context . reference ) {
169+ replaceWith ( [ ] )
170+ return
171+ }
172+
165173 let params = segment ( node . params , ' ' )
166174 for ( let param of params ) {
167175 if ( param . startsWith ( 'source(' ) ) {
You can’t perform that action at this time.
0 commit comments