[v4] @tailwindcss/vite Cannot apply unknown utility class in @apply #16278
Replies: 9 comments 5 replies
-
You need to use the As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding |
Beta Was this translation helpful? Give feedback.
-
You need to use it like this .my-class { |
Beta Was this translation helpful? Give feedback.
-
Is there a simple way to support |
Beta Was this translation helpful? Give feedback.
-
For whom is working with react 19, Tailwind v4 in 2025: |
Beta Was this translation helpful? Give feedback.
-
This change is terrible. I choose V3. |
Beta Was this translation helpful? Give feedback.
-
facing similar issue. For me it is not with @apply but with @plugin
Anyone has a solution / fix to use with V4 ? |
Beta Was this translation helpful? Give feedback.
-
Same issue. This change of v4 is terrible. |
Beta Was this translation helpful? Give feedback.
-
Anyone have any luck with using @reference in SCSS? |
Beta Was this translation helpful? Give feedback.
-
I can't even build with this simple code.
|
Beta Was this translation helpful? Give feedback.
-
What version of Tailwind CSS are you using?
"tailwindcss": "^4.0.3"
What build tool (or framework if it abstracts the build tool) are you using?
"nuxt": "^3.15.4"
with@tailwindcss/vite
What version of Node.js are you using?
v20.18.2
What browser are you using?
Chrome
What operating system are you using?
Windows
Reproduction URL
https://github.com/mathias22osterhagen22/tailwindcss-issue
Describe your issue
I'm having
[vite-node] [plugin:@tailwindcss/vite:generate:serve] [VITE_ERROR]
Cannot apply unknown utility class: hover:text-primary/70
in my Nuxt project.My
assets/css/main.css
:In my component I'm trying to create a custom class that apply tailwind classes:
But impossible to make it work.
I can only use it by writing it directly in the Vue template
<a class="hover:text-primary/70">
, which is kind of super annoying.Note:
I as well figured out while during the creation of the reproduction repo, than the original classes (
text-2xl
) are now as well broken (I didn't have this issue with my original project).So it seems to be linked with : #16255
Beta Was this translation helpful? Give feedback.
All reactions