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