You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-2Lines changed: 33 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ This setting is application scoped and changing the setting requires restarting
29
29
30
30
## Specifying Style Sheets
31
31
32
-
Remote and local style sheets with optional glob patterns can be specified in VS Code settings per workspace folder in `.vscode/settings.json` and will suggest in all configured languages within that workspace folder.
32
+
Remote and local style sheets with optional glob patterns and variable substitutions can be specified in VS Code settings per workspace folder in `.vscode/settings.json` and will suggest in all configured languages within that workspace folder.
33
33
34
34
Glob patterns for local style sheets can have the following syntax:
35
35
@@ -41,9 +41,16 @@ Glob patterns for local style sheets can have the following syntax:
41
41
|`{}`| group conditions like `**/*.{css,scss}`|
42
42
|`[]`| a range of characters like `[0-9]` or negate `[!0-9]`|
43
43
44
+
The following variable substitutions are supported for local style sheets as well:
|`${fileBasenameNoExtension}`| Current file's basename with no extension |
50
+
44
51
## Examples
45
52
46
-
Configuration depends on your layout of the project. The following most basic setting will suggest from all `css` files in project's `src` folder:
53
+
Configuration depends on your layout of the project. The following most basic setup will suggest from all `css` files in project's `src` folder:
47
54
48
55
**`.vscode/settings.json`**
49
56
@@ -103,6 +110,16 @@ Component's [static styles](https://lit.dev/docs/components/styles/) will be ava
103
110
}
104
111
```
105
112
113
+
Variable substitution can be used to refer to a related `css` file. If you are working on `my-component.ts` and your `css` is in `my-component-css.ts` then a suitable setup can be:
Install your favorite Vue language extension from [Marketplace](https://marketplace.visualstudio.com/search?term=tag%3Avue&target=VSCode&category=All%20categories&sortBy=Relevance) which registers `vue` language id then enable `vue` in global settings and restart VS Code:
@@ -115,6 +132,20 @@ Install your favorite Vue language extension from [Marketplace](https://marketpl
115
132
116
133
Styles defined in component's `<style>` section will be available for completion in component's `<template>` section.
117
134
135
+
### [Angular](https://angular.io/)
136
+
137
+
Variable substitution can be used for Angular development:
With this setup, styles defined in e.g. `app.component.css` will be available in `app.component.html`.
148
+
118
149
## Go to Definition
119
150
120
151
Go to definition for `id` and `class` selectors for local style sheets are supported. Selecting `Go to Definition` from context menu (`F12` or `⌘ click`) on a selector will open the local style sheet which the selector is defined.
0 commit comments