Unknown at rule @tailwindcss(unknownAtRules)
Probrem
VS Code says Unknown at rule @tailwindcss(unknownAtRules) in my Tailwind CSS. https://gyazo.com/2f51318c78f696a904a38fc7bb706801
https://gyazo.com/2b1e5a347aa3a3478b1976e3943ec312
Solution
Install @id:stylelint.vscode-stylelint
https://gyazo.com/00c129395d01cc36b6c63ea936dc4227
Add a stylelint configuration file.
code:js
module.exports = {
rules: {
'at-rule-no-unknown': [true, {
ignoreAtRules: [
'tailwind',
'apply',
'variants',
'responsive',
'screen'
]
}],
'declaration-block-trailing-semicolon': null,
'no-descending-specificity': null
}
}
Install recommended config
npm install stylelint-config-recommended --save-dev
Add it to your stylelint.config.js
code:js
module.exports = {
rules: {
...
}
}
Disable vscode's default CSS linting
https://gyazo.com/2b10b413f6f5b907680651bcf6ab29c7
https://gyazo.com/fdb2bd3c65eb92919e255908f9ffad28
Ref.