Skip to content

Commit

Permalink
Update the forceInclude regex to be specific
Browse files Browse the repository at this point in the history
This new regex will match selectors like the following:
:where(), :has(), :not(), :host(), :root().

Verified that it will not match selectors like the following:
li(:last-child), .green:not(:disabled), .card-hover:hover.
  • Loading branch information
batbattur committed May 11, 2023
1 parent 18eb07c commit 80656ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion critical-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function findCriticalCss(cssString, url) {
height: 2160,
blockJSRequests: false,
forceExclude: excludeArr,
forceInclude: [/where/i],
forceInclude: [/^:(\w+)\(/i],
screenshots: {
basePath: getScreenshotPath(url),
type: 'jpeg',
Expand Down

0 comments on commit 80656ab

Please sign in to comment.