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
> [PostCSS](https://github.com/postcss/postcss) plugin to transform [W3C CSS Extensions(Custom Selectors)](http://dev.w3.org/csswg/css-extensions/#custom-selectors) to more compatible CSS.
This option allows you to customize an object to set the `<extension-name>` (selector alias) and `<selector>`, these definitions will cover the same alias of `@custom-selector` in CSS.
133
+
134
+
```js
135
+
var options = {
136
+
extensions: {
137
+
':--any':'section, article, aside, nav'
138
+
}
139
+
}
140
+
141
+
var output =postcss(selector(options))
142
+
.process(css)
143
+
.css;
144
+
```
145
+
146
+
input.css
147
+
148
+
```css
149
+
@custom-selector :--any .foo, .bar; /* No effect */
150
+
:--any h1 {
151
+
margin-top: 16px;
152
+
}
153
+
```
154
+
155
+
output:
156
+
157
+
```css
158
+
/* No effect */
159
+
sectionh1,
160
+
articleh1,
161
+
asideh1,
162
+
navh1 {
163
+
margin-top: 16px;
164
+
}
165
+
```
166
+
167
+
### `transformMatches`
168
+
169
+
_(default: `true`)_
112
170
113
-
.demo :--heading, a:--any-link {
114
-
font-size: 32px;
171
+
Allows you to limit transformation to `:matches()` usage
This option allows you to customize an object to set the `<extension-name>` (selector alias) and `<selector>`, these definitions will cover the same alias of `@custom-selector` in CSS.
239
-
240
-
```js
241
-
var options = {
242
-
extensions: {
243
-
':--any':'section, article, aside, nav'
244
-
}
245
-
}
246
-
247
-
var output =postcss(selector(options))
248
-
.process(css)
249
-
.css;
250
-
```
251
-
252
-
input.css
253
-
254
-
```css
255
-
@custom-selector :--any .foo, .bar; /* No effect */
0 commit comments