Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules are being pruned even if the rule was skipped due to an error #47

Closed
mdawar opened this issue Jan 3, 2020 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@mdawar
Copy link

mdawar commented Jan 3, 2020

CSS rules are being removed from the external stylesheet even if the rules were skipped due to an error and weren't inlined.

For example the CSS that I'm using contains :focus-within which seems to be not supported by JSDOM and that's why it's throwing an error.

This is the sample output when this issue happens:

95% emitting HtmlWebpackPlugin⚠ 「Critters」: 4 rules skipped due to selector errors:
  .navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:focus-within .navbar-link -> '.navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:focus-within .navbar-link' is not a valid selector
  .navbar-item.is-hoverable:focus-within .navbar-dropdown -> '.navbar-item.is-hoverable:focus-within .navbar-dropdown' is not a valid selector
  .navbar.is-spaced .navbar-item.is-hoverable:focus-within .navbar-dropdown -> '.navbar.is-spaced .navbar-item.is-hoverable:focus-within .navbar-dropdown' is not a valid selector
  .navbar-item.is-hoverable:focus-within .navbar-dropdown.is-boxed -> '.navbar-item.is-hoverable:focus-within .navbar-dropdown.is-boxed' is not a valid selector
ℹ 「Critters」: Inlined 645 B (0% of original 213 kB) of static/css/app.94517.css.

For now if we set the pruneSource option to false it solves the problem temporarily, of course this has the drawback of keeping the inlined styles in the external stylesheet.

To reproduce the problem, I have added a prune-source branch on the critters-vue-example repository, you just need to:

git clone git@github.com:mdawar/critters-vue-example.git
git checkout prune-source
npm install
npm run build
@developit
Copy link
Collaborator

:focus-within is supported in Critters as of 0.0.11 (#69).

@developit developit added the bug Something isn't working label Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants