Changes in Tailwind CSS v4
已经有一个关联 PR 被合并了。
- #991 来自 @ineshbose —— 已合并
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- nuxt, tailwindcss
- 领域
- build-system, frontend
调研方向
Start with the Tailwind CSS v4 prerelease documentation and compare its configuration, source detection, and theme-variable changes with the module's current behavior. Review the discussion and existing features such as hooks and exposeConfig; done requires a decided migration direction and agreed scope for the next module version.
由索引模型根据 Issue 内容生成。
描述
Hi everyone,
I'm creating this issue to get an idea from the users of this module about certain changes and features in Tailwind CSS v4 that they'd like this module to integrate with.
If you haven't already, do give a read to the v4 prerelease documentation that covers all the changes:
https://tailwindcss.com/docs/v4-beta
I mention in #790 that this module mostly aims at installing and configuring Tailwind to your Nuxt project a breeze, and with this new version, Tailwind CSS has made it even easier; still, there are minor steps like configuring Vite within Nuxt (or webpack/other builders using PostCSS), setting up CSS, merging all the Nuxt layers, etc -- this is where the module would still be required.
There are a few more things that have changed in Tailwind CSS v4 that heavily influence on the approach for the next version of this module; I'm hoping to get comments on these functionalities (and more general bits I may have missed).
Configuration
Previously Tailwind required us to create a tailwind.config.js to enable minimum installation; this configuration file also helps in using plugins, safelists, and extending theme. This is no longer necessary, you can use v4 without a configuration file.
How would you configure the theme?
The idea of Tailwind v4 is that it will be more tailwind.css configuration focused, than tailwind.config.cjs (based on my understanding from this video). So, you have the @theme directive. Read more about this here - https://tailwindcss.com/docs/v4-beta#customizing-your-theme
With that said, any (existing) configuration files can still be used in v4 - https://tailwindcss.com/docs/v4-beta#using-legacy-configuration-files - but it will not be highly configurable through this approach (also note the usage of word "legacy").
Content Configuration
When creating a tailwind.config file, you were required to specify resolvable paths to your source code in the content property. This module also did that for you, so it wasn't necessary. However, projects have different natures of organising source code. Moreover, a file may exist in the tracker but not in the app lifecycle/tree; the class utilities from that file would still contribute to the final CSS.
Tailwind v4 now looks at the module graph and detects utilities accordingly. Still, paths can be configured explicitly; read https://tailwindcss.com/docs/v4-beta#configuring-source-detection.
Exposed CSS variables
There was a little section in Tailwind v3 docs about referencing (configuration) in JavaScript. Here again this module provided an exposeConfig feature 👼 that would provide tree-shakable, typed values to your configurations.
Tailwind v4 is based on CSS variables now, and the resolveConfig function is not exported anymore. https://tailwindcss.com/docs/v4-beta#referencing-theme-values-in-js
Given some of the changes pointed above, I'm trying to brainstorm on where we go next. It may be possible to maintain the current usage of the module to work with v4, but it may not enable its best potential. We can also change into a tailwind.css based module (have the module generate it and automatically integrate) which seems like a nice idea. We could just be a simple Vite/PostCSS plugin installer too 😄
So here's what I'm hoping to hear from you:
- are there current features from the module that you use and heavily rely on? (hooks, exposeConfig, etc)
- how much configuration do you tend to use for Tailwind, and if you'd move to using the new
@theme,@plugin, etc. directives? - is there anything in Tailwind v4 changes that you would want the module to bank on (like no longer providing our own content paths to use automatic detection, and also remove
exposeConfigto use CSS variables), or possibly still have those abilities (that may not be as-usable at their best potential)?
Let me know what you all think. I'm excited to take this new exciting route that hopefully everyone can enjoy!
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 193
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt-modules/tailwindcss 的其他 Issue
-
bug
难度 4/5 1-2 天 新手友好度 58/100
nuxt-modules/tailwindcss#1047 ·
-
Version 6未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
nuxt-modules/tailwindcss#1042 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
nuxt-modules/tailwindcss#1039 · 2 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 45/100
nuxt-modules/tailwindcss#1034 · 1 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
nuxt-modules/tailwindcss#1033 · 1 条评论 ·
查看 nuxt-modules/tailwindcss 的全部 Issue
相似的 Issue
-
component:sight
难度 2/5 1-3 小时 新手友好度 78/100
agentic-os-org/ANOLISA#6738 · 2 条评论 ·
维护者通常 1 天内回复
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
难度 2/5 1-3 小时 新手友好度 82/100
mastra-ai/mastra#26470 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
paperclipai/paperclip#15630 ·
维护者通常 1 天内回复
-
[good first issue, hacktoberfest] ⛩️ Add new Theme: Sakura Latte (good-first-issue)可能已有人在做 @PGrayCS 今天认领。 未关闭community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1-3 小时 新手友好度 78/100
lingdojo/kana-dojo#31937 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
feature/cohorts feature/feature-flags team/feature-flags
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复