Skip to content

Commit 5b98271

Browse files
committed
update doc
1 parent 8ebc997 commit 5b98271

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to the extension will be documented in this file.
66

77
- Added optional auto validation
88
- Added feedback for clear cache
9+
- Updated documentation
910
- Updated dependencies
1011

1112
## [2.0.7] - 2024-01-23

README.md

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,6 @@ HTML `id` and `class` attribute completion for Visual Studio Code.
1717

1818
You can view a list of `id` and `class` attribute suggestions in configured languages.
1919

20-
## Specifying Style Sheets
21-
22-
Style sheets can be specified in VS Code settings per workspace folder in `.vscode/settings.json` and will suggest for all configured languages within that workspace folder.
23-
24-
### Example
25-
26-
**`.vscode/settings.json`**
27-
28-
```json
29-
{
30-
"css.styleSheets": [
31-
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",
32-
"node_modules/bootstrap/dist/css/bootstrap.css",
33-
"src/**/*.scss",
34-
"src/view/style.ts",
35-
"dist/style.css"
36-
]
37-
}
38-
```
39-
4020
## Supported Languages
4121

4222
Supported languages can be configured with the `css.enabledLanguages` setting. By default `html` is enabled:
@@ -51,13 +31,38 @@ Extension can be configured to support any language where it makes sense such as
5131

5232
This setting is application scoped and changing the setting requires restarting VS Code.
5333

34+
## Specifying Style Sheets
35+
36+
Style sheets can be specified in VS Code settings per workspace folder in `.vscode/settings.json` and will suggest for all configured languages within that workspace folder.
37+
38+
### Glob Patterns
39+
40+
Glob patterns can have the following syntax:
41+
42+
| Pattern | Matches |
43+
| ------- | ------------------------------------------- |
44+
| `*` | zero or more characters in a path segment |
45+
| `?` | one character in a path segment |
46+
| `**` | any number of path segments, including none |
47+
| `{}` | group conditions like `**​/*.{ts,js}` |
48+
| `[]` | declare a range of characters like `[0-9]` |
49+
| `[!]` | negate a range of characters like `[!0-9]` |
50+
5451
## Examples
5552

56-
Configuration depends on your layout of the project but some samples are below:
53+
Configuration depends on your layout of the project. The following most basic settings will suggest from all your css files in your project's `src` folder:
54+
55+
**`.vscode/settings.json`**
56+
57+
```json
58+
{
59+
"css.styleSheets": ["src/**/*.css"]
60+
}
61+
```
5762

5863
### Bootstrap
5964

60-
If you are using Bootstrap npm module:
65+
If you are using Bootstrap `npm` module with additional `scss` this can be a starting point:
6166

6267
```json
6368
{
@@ -68,36 +73,40 @@ If you are using Bootstrap npm module:
6873
}
6974
```
7075

71-
If you are using Bootstrap CDN:
76+
and if you are using Bootstrap CDN with additional plain `css`:
7277

7378
```json
7479
{
7580
"css.styleSheets": [
7681
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",
77-
"src/**/*.scss"
82+
"src/**/*.css"
7883
]
7984
}
8085
```
8186

8287
### Lit
8388

89+
First `typescript` or `javascript` should be enabled in global settings depending on your needs:
90+
8491
```json
8592
{
8693
"css.enabledLanguages": ["typescript"]
8794
}
8895
```
8996

97+
Your in file styles will be available for completion for that file. If you need to use some base styles everywhere you can specify as follows:
98+
9099
```json
91100
{
92-
"css.styleSheets": ["src/view/style.ts"]
101+
"css.styleSheets": ["src/base-styles.ts"]
93102
}
94103
```
95104

96105
## Commands
97106

98107
### Validate class selectors
99108

100-
Validates all `class` selectors in the active editor.
109+
Validates all `class` selectors in the active editor. Auto validation can also be configured in settings.
101110

102111
### Clear style sheets cache
103112

0 commit comments

Comments
 (0)