Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
Problem: you include Tailwind in a project and VS Code shows warnings like Unknown at rule for Tailwind-specific CSS.
With Tailwind v4, your CSS usually starts like this:
@import "tailwindcss";
@source "../views/**/*.blade.php";
@import is standard CSS, but Tailwind directives like @source (or @theme) can still trigger the warning.
Here are three ways to fix it.
1) Use Tailwind CSS language mode
Open a CSS file in your project, and from the VS Code Command Palette choose “Change Language Mode”, then pick “Tailwind CSS” from the list.
2) Associate CSS files with Tailwind CSS
Open .vscode/settings.json (create it if you don’t have it) and add:
{
"files.associations": {
"*.css": "tailwindcss"
}
}
3) Hide the warnings
Open the VS Code settings, search for “unknown”, and set CSS > Lint: Unknown At Rules to ignore.
Done!