diff --git a/packages/vscode/package.json b/packages/vscode/package.json index aa445f17e9..02a6ad290d 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -39,6 +39,11 @@ "type": "object", "title": "UnoCSS", "properties": { + "unocss.disable": { + "type": "boolean", + "default": false, + "description": "Disable the UnoCSS extension" + }, "unocss.root": { "type": "string", "description": "Project root that contains the UnoCSS configuration file" diff --git a/packages/vscode/src/index.ts b/packages/vscode/src/index.ts index 7831181ec6..bb3189f4a3 100644 --- a/packages/vscode/src/index.ts +++ b/packages/vscode/src/index.ts @@ -13,6 +13,10 @@ export async function activate(ext: ExtensionContext) { return const config = workspace.getConfiguration('unocss') + const disabled = config.get('disable', false) + if (disabled) + return + const root = config.get('root') const cwd = root ? path.resolve(projectPath, root) : projectPath