Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tailwind + WebStorm: "unknown CSS at rule"

I'm trying to use Tailwind with my WebStorm IDE, however, I get this error:

Unknown CSS at rule

whenever I use @apply or @tailwind

like image 867
Francesco Borzi Avatar asked Dec 17 '19 10:12

Francesco Borzi


People also ask

How do you fix the unknown at rule tailwind?

Here's how to fix this. Open the settings, search for “unknown”, the first result should be the one you're looking for: CSS > Lint: Unknown At Rules : Change that to ignore : Done!

Is TailwindCSS free?

Tailwind Starter Kit is a beautiful extension for TailwindCSS, which is Free and Open Source.


2 Answers

Tailwind is not currently supported, please follow WEB-42792 and linked tickets for updates.

Disabling Unknown CSS at-rule inspection in Preferences | Editor | Inspections | CSS | Invalid elements is the only way to avoid Unknown CSS At Rule error; note that some Tailwind rules can cause syntax errors that come from low level checking and can't be disabled (like Unexpected token, etc.). In such cases, I can only suggest turning the syntax highlighting off for such files to avoid errors: open your file in editor, click the Hector icon in the lower right corner and then move the slider to change the Highlighting level to None, then re-open the project. See https://www.jetbrains.com/help/phpstorm/disabling-and-enabling-inspections.html#change-highlighting-level-for-file.

like image 83
lena Avatar answered Oct 23 '22 21:10

lena


If you don't want to disable at-rules errors in your configuration IDE. You can choose this syntax. Hope this will help :)

// noinspection CssInvalidAtRule
@tailwind base;
// noinspection CssInvalidAtRule
@tailwind components;
// noinspection CssInvalidAtRule
@tailwind utilities;
like image 28
unloogle Avatar answered Oct 23 '22 23:10

unloogle