web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
734 B

  1. import postcss from 'postcss';
  2. const selectorRegExp = /:focus-visible([^\w-]|$)/gi;
  3. var index = postcss.plugin('postcss-focus-visible', opts => {
  4. const replaceWith = String(Object(opts).replaceWith || '.focus-visible');
  5. const preserve = Boolean('preserve' in Object(opts) ? opts.preserve : true);
  6. return root => {
  7. root.walkRules(selectorRegExp, rule => {
  8. const selector = rule.selector.replace(selectorRegExp, ($0, $1) => {
  9. return `${replaceWith}${$1}`;
  10. });
  11. const clone = rule.clone({
  12. selector
  13. });
  14. if (preserve) {
  15. rule.before(clone);
  16. } else {
  17. rule.replaceWith(clone);
  18. }
  19. });
  20. };
  21. });
  22. export default index;
  23. //# sourceMappingURL=index.es.mjs.map