source: trip-planner-front/node_modules/postcss-focus-visible/index.es.mjs@ 6a80231

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

initial commit

  • Property mode set to 100644
File size: 734 bytes
RevLine 
[6a3a178]1import postcss from 'postcss';
2
3const selectorRegExp = /:focus-visible([^\w-]|$)/gi;
4var index = postcss.plugin('postcss-focus-visible', opts => {
5 const replaceWith = String(Object(opts).replaceWith || '.focus-visible');
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
25export default index;
26//# sourceMappingURL=index.es.mjs.map
Note: See TracBrowser for help on using the repository browser.