Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
721 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | import postcss from 'postcss';
|
---|
| 2 |
|
---|
| 3 | const selectorRegExp = /:blank([^\w-]|$)/gi;
|
---|
| 4 | var postcss$1 = postcss.plugin('css-blank-pseudo', opts => {
|
---|
| 5 | const replaceWith = String(Object(opts).replaceWith || '[blank]');
|
---|
| 6 | const preserve = Boolean('preserve' in Object(opts) ? opts.preserve : true);
|
---|
| 7 | return root => {
|
---|
| 8 | root.walkRules(selectorRegExp, rule => {
|
---|
| 9 | const selector = rule.selector.replace(selectorRegExp, ($0, $1) => {
|
---|
| 10 | return `${replaceWith}${$1}`;
|
---|
| 11 | });
|
---|
| 12 | const clone = rule.clone({
|
---|
| 13 | selector
|
---|
| 14 | });
|
---|
| 15 |
|
---|
| 16 | if (preserve) {
|
---|
| 17 | rule.before(clone);
|
---|
| 18 | } else {
|
---|
| 19 | rule.replaceWith(clone);
|
---|
| 20 | }
|
---|
| 21 | });
|
---|
| 22 | };
|
---|
| 23 | });
|
---|
| 24 |
|
---|
| 25 | export default postcss$1;
|
---|
| 26 | //# sourceMappingURL=postcss.mjs.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.