mirror of
https://github.com/hanzoai/tailwindcss.git
synced 2026-09-24 17:03:14 +00:00
fix(@tailwindcss/vite): include @variant in feature detection (#19966)
Fixes #19964 CSS files imported via JS that only use `@variant` (no `@apply`, `theme()`, or utility classes) are silently skipped by the Vite plugin. The `@variant` directive gets passed through raw to the browser, which drops it as an unknown at-rule. **Root cause** — `Features.Variants` is missing from the [feature detection bitmask](https://github.com/tailwindlabs/tailwindcss/blob/v4.2.4/packages/%40tailwindcss-vite/src/index.ts#L526): ```ts // before Features.AtApply | Features.JsPluginCompat | Features.ThemeFunction | Features.Utilities // after Features.AtApply | Features.JsPluginCompat | Features.ThemeFunction | Features.Utilities | Features.Variants ``` **Reproduction** — https://github.com/remorses/tailwind-variant-bug --------- Co-authored-by: Robin Malfait <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Robin Malfait
parent
9a97d8fdf3
commit
b91bd4cede
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Ensure `@plugin` resolves package JavaScript entries instead of browser CSS entries when using `@tailwindcss/vite` ([#19949](https://github.com/tailwindlabs/tailwindcss/pull/19949))
|
||||
- Fix relative `@import` and `@plugin` paths resolving from the wrong directory when using `@tailwindcss/vite` ([#19965](https://github.com/tailwindlabs/tailwindcss/pull/19965))
|
||||
- Ensure CSS files containing `@variant` are processed by `@tailwindcss/vite` ([#19966](https://github.com/tailwindlabs/tailwindcss/pull/19966))
|
||||
|
||||
## [4.2.4] - 2026-04-21
|
||||
|
||||
|
||||
@@ -537,7 +537,11 @@ class Root {
|
||||
if (
|
||||
!(
|
||||
this.compiler.features &
|
||||
(Features.AtApply | Features.JsPluginCompat | Features.ThemeFunction | Features.Utilities)
|
||||
(Features.AtApply |
|
||||
Features.JsPluginCompat |
|
||||
Features.ThemeFunction |
|
||||
Features.Utilities |
|
||||
Features.Variants)
|
||||
)
|
||||
) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user