File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
25
- Use ` default ` export condition for ` @tailwindcss/vite ` ([ #18948 ] ( https://github.com/tailwindlabs/tailwindcss/pull/18948 ) )
26
26
- Re-throw errors from PostCSS nodes ([ #18373 ] ( https://github.com/tailwindlabs/tailwindcss/pull/18373 ) )
27
27
- Detect classes in markdown inline directives ([ #18967 ] ( https://github.com/tailwindlabs/tailwindcss/pull/18967 ) )
28
+ - Ensure files with only ` @theme ` produce no output when built ([ #18979 ] ( https://github.com/tailwindlabs/tailwindcss/pull/18979 ) )
28
29
29
30
## [ 4.1.13] - 2025-09-03
30
31
Original file line number Diff line number Diff line change @@ -5965,4 +5965,18 @@ describe('feature detection', () => {
5965
5965
expect ( compiler . features & Features . AtImport ) . toBeTruthy ( )
5966
5966
expect ( compiler . features & Features . Utilities ) . toBeFalsy ( )
5967
5967
} )
5968
+
5969
+ test ( 'using `@theme`' , async ( ) => {
5970
+ let compiler = await compile ( css `
5971
+ @theme {
5972
+ --tracking-narrower : -0.02em ;
5973
+ }
5974
+ ` )
5975
+
5976
+ // We see @theme
5977
+ expect ( compiler . features & Features . AtTheme ) . toBeTruthy ( )
5978
+
5979
+ // And this produces no output because no other CSS is present
5980
+ expect ( compiler . build ( [ ] ) ) . toEqual ( '' )
5981
+ } )
5968
5982
} )
Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ export const enum Features {
133
133
134
134
// `@variant` was used
135
135
Variants = 1 << 5 ,
136
+
137
+ // `@theme` was used
138
+ AtTheme = 1 << 6 ,
136
139
}
137
140
138
141
async function parseCss (
@@ -540,6 +543,8 @@ async function parseCss(
540
543
if ( node . name === '@theme' ) {
541
544
let [ themeOptions , themePrefix ] = parseThemeOptions ( node . params )
542
545
546
+ features |= Features . AtTheme
547
+
543
548
if ( context . reference ) {
544
549
themeOptions |= ThemeOptions . REFERENCE
545
550
}
You can’t perform that action at this time.
0 commit comments