Skip to content

Commit

Permalink
feat: extend experimental WC features
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Sep 25, 2021
1 parent bdc63e2 commit 272b678
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions file-content-injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@ const fs = require("fs");
match: String.raw`removeCustomProps(node['cssText']);`,
replacement: String.raw`reduceCalc(removeCustomProps(node['cssText']));`
},
// Have it remove all rules containing :focus-visible
{
action: "replace",
file: "node_modules/@webcomponents/shadycss-experimental/src/style-transformer.js",
match: String.raw`const MATCHES =`,
replacement: `const FOCUS_VISIBLE = /:(?:focus-visible)/;\nconst MATCHES =`
},
{
action: "replace",
file: "node_modules/@webcomponents/shadycss-experimental/src/style-transformer.js",
match: String.raw`let stop = false;`,
replacement: String.raw`
let stop = false;
const isFocusVisible = FOCUS_VISIBLE.test(selector);
if (isFocusVisible) {
return undefined;
}`
},

].forEach(replace);

Expand Down

0 comments on commit 272b678

Please sign in to comment.