unocss: Unknown at rule @apply
UnoCSS version
0.50.3
Describe the bug
The @apply is working, but VS Code annoys me with a ton of errors:
Reproduction
vite.config.ts:
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import UnoCSS from "unocss/vite";
import { presetUno, presetIcons, extractorSvelte, transformerDirectives } from "unocss";
import { presetDaisy } from "unocss-preset-daisy";
export default defineConfig({
server: {
host: "0.0.0.0",
},
plugins: [
UnoCSS({
transformers: [transformerDirectives()],
extractors: [extractorSvelte],
shortcuts: [
{
"svg-rule": "text-6 ma block",
},
],
presets: [
presetUno(),
presetDaisy(),
presetIcons({
}),
],
theme: {
// This is NOT a theme name, it must be `colors`
colors: {},
},
}),
sveltekit(),
],
});
System Info
No response
Validations
- Read the Contributing Guidelines.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (2 by maintainers)
Since we have vscode extension for unocss, shall we add support for
@apply
in the extension just like whatpostcss
/tailwindcss
do?custom-at-rules
support, both postcss and tailwindcss support thiscss.customData
I use @unocss/eslint-config too, but there’re still the warnings. Could you please tell me how does it work?
Guys, the solution:
.vscode/settings.json
.vscode/unocss.json