File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff 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
150161If your web application doesn't target all Baseline browsers then you can safely disable this rule.
You can’t perform that action at this time.
0 commit comments