0

No matter what I do I cannot fix the errors: Unknown at rule @tailwind css(unkownAtRules) and: Unknown at rule @apply

I am using React, I've installed everything necessary and tried all the suggestions from AI tools like copilot. All my config files look good.

I tried clearing the cache, double checking everything was installed correctly and config files were right. No change to the errors.

  • Are these error in the browser? – Konrad Aug 17 '23 at 21:12
  • 2
    Sounds like your IDE is preventing you from using it as intended. Sometimes you need to edit a configuration option in VS Code for example to ignore ruling on custom @ rules like @tailwind. For context, [this is what I'm talking about](https://byby.dev/at-rule-tailwind#:~:text=There%20are%20several%20ways%20to,this%20by%20opening%20the%20settings) – Andy Holmes Aug 17 '23 at 21:15

1 Answers1

0

To me, it sounds like your IDE/Code editor isn't allowing the custom @ directives that Tailwind uses.

For example, in VS Code you will need to open your settings.json file and add this rule:

{
  "css.lint.unknownAtRules": "ignore"
}

Or, if you're using something like SCSS:

{
  "scss.lint.unknownAtRules": "ignore"
}

I hope this points you in the right direction. Remember to restart your editor once you've made changes.

Andy Holmes
  • 7,817
  • 10
  • 50
  • 83
  • That worked in the workspace settings.json file. Thank you! Now I'm getting a spelling error on this line in the settings.json user file even though i didnt change it: "liveServer.settings.donotShowInfoMsg": true, – Andrew Escudero Aug 17 '23 at 21:34
  • It says donot is an unknown word. Also getting an error with a font, satoshi, which is coming up as an unkown word. – Andrew Escudero Aug 17 '23 at 21:35
  • Not sure if it helps but maybe check the info here - https://stackoverflow.com/questions/70698795/live-server-problem-with-settings-json-being-for-a-different-extension - I only really know the answer to your original question, which is what my answer solved – Andy Holmes Aug 17 '23 at 21:43