File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -380,18 +380,24 @@ async function parseCss(
380380
381381 // Handle `@media theme(…)`
382382 //
383- // We support `@import "tailwindcss/theme " theme(reference)` as a way to
383+ // We support `@import "tailwindcss" theme(reference)` as a way to
384384 // import an external theme file as a reference, which becomes `@media
385385 // theme(reference) { … }` when the `@import` is processed.
386386 else if ( param . startsWith ( 'theme(' ) ) {
387387 let themeParams = param . slice ( 6 , - 1 )
388+ let hasReference = themeParams . includes ( 'reference' )
388389
389390 walk ( node . nodes , ( child ) => {
390391 if ( child . kind !== 'at-rule' ) {
391- throw new Error (
392- 'Files imported with `@import "…" theme(…)` must only contain `@theme` blocks.' ,
393- )
392+ if ( hasReference ) {
393+ throw new Error (
394+ `Files imported with \`@import "…" theme(reference)\` must only contain \`@theme\` blocks.\nUse \`@reference "…";\` instead.` ,
395+ )
396+ }
397+
398+ return WalkAction . Continue
394399 }
400+
395401 if ( child . name === '@theme' ) {
396402 child . params += ' ' + themeParams
397403 return WalkAction . Skip
You can’t perform that action at this time.
0 commit comments