GoogleChromeLabs / critters

🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
https://npm.im/critters-webpack-plugin
Apache License 2.0
3.44k stars 108 forks source link

Error when using `:where` - `subselects_1.subselects[name]` #90

Closed wSedlacek closed 2 years ago

wSedlacek commented 2 years ago

When using the :where selector with critters@0.0.14 as part of @angular-devkit/build-angular@13.0.4 like in the following selector:

/* Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property */
*:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {
  all: unset;
  display: revert;
}

I get the following warning in my console

Warning: 1 rules skipped due to selector errors:
  *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) -> subselects_1.subselects[name] is not a function

And the selector does not get inlined.

wSedlacek commented 2 years ago

Recreation: https://stackblitz.com/edit/node-yfjhw4?file=index.ts npm run start

developit commented 2 years ago

This is fixed by fb55/css-select#582, which was merged on Oct 15th but has not yet been released.

jeripeierSBB commented 2 years ago

The fix of css-select was published with version 4.2.0 https://github.com/fb55/css-select/releases/tag/v4.2.0