source: trip-planner-front/node_modules/css-blank-pseudo/postcss.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 873 bytes
Line 
1'use strict';
2
3function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
5var postcss = _interopDefault(require('postcss'));
6
7const selectorRegExp = /:blank([^\w-]|$)/gi;
8var 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
29module.exports = postcss$1;
30//# sourceMappingURL=postcss.js.map
Note: See TracBrowser for help on using the repository browser.