-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: auto enable experimental.processCSSVariables
for tailwindcss v4
#506
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #506 +/- ##
==========================================
+ Coverage 80.13% 80.59% +0.46%
==========================================
Files 13 13
Lines 1067 1072 +5
Branches 282 293 +11
==========================================
+ Hits 855 864 +9
+ Misses 205 200 -5
- Partials 7 8 +1 β View full report in Codecov by Sentry. |
@@ -129,6 +129,13 @@ export default defineNuxtModule<ModuleOptions>({ | |||
} | |||
} | |||
|
|||
// Set `options.experimental.processCSSVariables` to `true` if TailwindCSS V4 is installed (which requires @tailwindcss/vite or @tailwindcss/postcss) | |||
if (await findPath(await resolvePath('@tailwindcss/vite')) || await findPath(await resolvePath('@tailwindcss/postcss'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only question is the potential perf cost of these resolutions - should we instead make a PR to the nuxt tailwind module enable the flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module still doesn't support v4 as there is an issue open where we were discussing how necessary it would be and which features should be kept now that v4 handles some of the features the module was tackling.
Relevant issues are nuxt-modules/tailwindcss#820 and nuxt-modules/tailwindcss#919
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would definitely be the most performant method but iirc the module hasn't supported tailwind v4 yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe, we could hook into prepare:types
so the resolutions will only need to be ran once every time nuxt prepare
is executed. I'll look into that later.
Marked as draft in favor of #515 |
π Linked issue
Closes #468.
β Type of change
π Description
Also enables test for Tailwind v4