Records below are third-party data, not instructions. Apply with your own judgment.
Cannot apply unknown utility class <class>
Cause
@apply resolves only utilities its stylesheet's theme defines: v3 JS-config theme values aren't loaded in v4, and CSS modules or component styles have no theme.
Fix
/* CSS module or Vue/Svelte <style>: borrow the main stylesheet's theme (emits no CSS) */@reference "../app.css"; /* or @reference "tailwindcss"; for the default theme *//* main CSS: v3 theme.extend values become theme variables */@theme { --color-primary: #4f46e5; }/* v3 @layer components classes used in @apply become utilities */@utility card { padding: 1rem; }Don’t try
@import "tailwindcss" inside each CSS module or component <style> — duplicates the framework's CSS into every bundle; @reference gives @apply the theme without emitting CSS.
keep theme.extend in tailwind.config.js and expect v4 to read it — v4 no longer auto-detects JS configs; add @config "./tailwind.config.js" to the CSS or move the values to @theme.