5
5
[ ![ Windows Build Status] [ win-img ]] [ win-url ]
6
6
[ ![ Gitter Chat] [ git-img ]] [ git-url ]
7
7
8
- [ PostCSS Focus Ring] lets you use the ` :focus-ring ` pseudo-selector in CSS,
8
+ [ PostCSS Focus Ring] lets you use the ` :focus-visible ` pseudo-selector in CSS,
9
9
following the [ Selectors Level 4] specification.
10
10
11
11
``` css
12
- :focus:not (:focus-ring ) {
12
+ :focus:not (:focus-visible ) {
13
13
outline : none ;
14
14
}
15
15
```
16
16
17
- Use PostCSS Focus Ring alongside the [ focus-ring polyfill] to swap the
17
+ Use PostCSS Focus Ring alongside the [ focus-visible polyfill] to swap the
18
18
pseudo-selector for a class, which maintains the same selector weight.
19
19
20
20
``` css
21
- :focus:not (.focus-ring ) {
21
+ :focus:not (.focus-visible ) {
22
22
outline : none ;
23
23
}
24
24
```
@@ -35,9 +35,9 @@ require('postcss-focus-ring')({
35
35
36
36
``` json
37
37
[
38
- " .focus-ring " ,
39
- " .x-component-outside .focus-ring " ,
40
- " .focus-ring .x-component-inside" ,
38
+ " .focus-visible " ,
39
+ " .x-component-outside .focus-visible " ,
40
+ " .focus-visible .x-component-inside" ,
41
41
]
42
42
```
43
43
@@ -51,14 +51,14 @@ require('postcss-focus-ring')({
51
51
52
52
``` js
53
53
export default [
54
- " .focus-ring " ,
55
- " .x-component-outside .focus-ring " ,
56
- " .focus-ring .x-component-inside" ,
54
+ " .focus-visible " ,
55
+ " .x-component-outside .focus-visible " ,
56
+ " .focus-visible .x-component-inside" ,
57
57
];
58
58
```
59
59
60
60
With these variables synchronized to JavaScript, they can be used alongside the
61
- [ focus-ring polyfill] .
61
+ [ focus-visible polyfill] .
62
62
63
63
## Usage
64
64
@@ -154,15 +154,15 @@ require('postcss-focus-ring')({ /* options */ });
154
154
#### exportAs
155
155
156
156
` exportAs ` is used to export transformed selectors originally containing the
157
- ` :focus-ring ` pseudo-selector.
157
+ ` :focus-visible ` pseudo-selector.
158
158
159
159
- If a ` js ` string is passed, the selectors will be exported as JavaScript.
160
160
- If a ` json ` string is passed, the selectors will be exported as JSON.
161
161
162
162
#### exportTo
163
163
164
164
` exportTo ` is the path to where your JSON or JavaScript will be saved. By
165
- default, it is the CSS source file with an additional ` focus-ring -selectors `
165
+ default, it is the CSS source file with an additional ` focus-visible -selectors `
166
166
and ` .js ` or ` .json ` extension.
167
167
168
168
#### assignTo
@@ -183,5 +183,5 @@ be useful if running the plugin on the client side.
183
183
[ PostCSS ] : https://github.com/postcss/postcss
184
184
[ Gulp PostCSS ] : https://github.com/postcss/gulp-postcss
185
185
[ Grunt PostCSS ] : https://github.com/nDmitry/grunt-postcss
186
- [ Selectors Level 4 ] : https://drafts.csswg.org/selectors-4/#the-focusring -pseudo
187
- [ focus-ring polyfill ] : https://github.com/WICG/focus-ring
186
+ [ Selectors Level 4 ] : https://drafts.csswg.org/selectors-4/#the-focus-visible -pseudo
187
+ [ focus-visible polyfill ] : https://github.com/WICG/focus-ring
0 commit comments