Skip to content

Commit 9c0c4ec

Browse files
committed
docs: improve use-baseline rule options docs
1 parent ca1bf18 commit 9c0c4ec

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

docs/rules/use-baseline.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,30 @@ Examples of **correct** code with `{ allowProperties: ["user-select"] }`:
132132

133133
- `allowSelectors` (default: `[]`) - Specify an array of selectors that are allowed to be used.
134134

135-
Examples of **correct** code with `{ allowSelectors: ["nesting", "has"] }`:
135+
When you want to allow the [& nesting selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector), you can use `"nesting"`.
136+
137+
Examples of **correct** code with `{ allowSelectors: ["nesting"] }`:
136138

137139
```css
138-
/* eslint css/use-baseline: ["error", { allowSelectors: ["nesting", "has"] }] */
140+
/* eslint css/use-baseline: ["error", { allowSelectors: ["nesting"] }] */
139141

140-
h1 {
141-
margin: 0 0 1rem 0;
142-
&:has(+ h2) {
143-
margin: 0 0 0.25rem 0;
142+
.parent {
143+
&:hover {
144+
background-color: blue;
144145
}
145146
}
146147
```
147148

149+
Examples of **correct** code with `{ allowSelectors: ["has"] }`:
150+
151+
```css
152+
/* eslint css/use-baseline: ["error", { allowSelectors: ["has"] }] */
153+
154+
h1:has(+ h2) {
155+
margin: 0 0 0.25rem 0;
156+
}
157+
```
158+
148159
## When Not to Use It
149160

150161
If your web application doesn't target all Baseline browsers then you can safely disable this rule.

0 commit comments

Comments
 (0)