54

enter image description here

cant able to resolve this error while compiling the code ..! In fact I've tried many other ways of implementation

//Index.css

@tailwind base;
@tailwind components;
@tailwind utilities;
2
  • 1
    Does this post answer your question? How to add a @tailwind CSS rule to css checker If not, can you please specify how the questions are different/distinct to help visitors understand how best to assist you? Commented Jan 5, 2022 at 18:33
  • install an extension called csstools.postcss on vscode and it'll fix most of the issues. Worked for me and figured out from people that it worked for them aswell. Commented Oct 24 at 7:09

1 Answer 1

156

Make sure to install PostCSS Language Support, extension found in the VSCODE. That will remove the error that is displaying.

@apply rule is compatible with postCSS: https://github.com/tailwindcss/tailwindcss/issues/325

VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=csstools.postcss

Sign up to request clarification or add additional context in comments.

2 Comments

My @tailwind rule is in a .scss file and your solution doesn't seem to work with SCSS files. As a workaround, I simply disabled the "unknownAtRules" error in the settings.json file of VSCode: { "scss.lint.unknownAtRules": "ignore" }
These days PostCSS VSC plugin is not that good - it messes up the built-in CSS Intellisense features, such as the color picker.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.