question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clean-css removes wildcard selector

See original GitHub issue

I’m using clean-css v3.0.7, and it seems like clean-css removes the wildcard selectors.

Before:

*,
*:before,
*:after {
    box-sizing: border-box;
}

After:

:before,:after{box-sizing:border-box}

Expected:

*,*:before,*:after{box-sizing:border-box}

I’ve tested all kinds of different arguments, but nothing seems to fix this. Any ideas?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:15

github_iconTop GitHub Comments

2reactions
epogeedesigncommented, Apr 10, 2022

As a note we found disabling this particular rule solved the issue:

new CleanCSS({
  level: {
    1: {
      tidySelectors: false // turns off optimizing selectors
    }
  }
});
0reactions
jakubpawlowiczcommented, May 11, 2022

Thanks @epogeedesign for the comment, it’s helpful for those who may stumble upon this behavior of clean-css.

Read more comments on GitHub >

github_iconTop Results From Across the Web

clean-css removes wildcard selector · Issue #444 - GitHub
I'm using clean-css v3.0.7, and it seems like clean-css removes the wildcard selectors. Before: *, *:before, *:after { box-sizing: ...
Read more >
Developers - clean-css removes wildcard selector - - Bountysource
I'm using clean-css v3.0.7, and it seems like clean-css removes the wildcard selectors. Before: *, *:before, *:after { box-sizing: border-box; }.
Read more >
wildcard * in CSS for classes - Stack Overflow
I tried using a wildcard * as in this css, but it didn't work. .tocolor-*{ background: red; }. css · css-selectors · wildcard....
Read more >
UnCSS your CSS! Removing Unused CSS with PostCSS ...
https://promo.linode.com/designcourse/ - Use code 'DESIGNC19' to get $20 credit on your new Linode account!-- Last week I released a video ...
Read more >
Crittr - npm.io
Every CSS Selector in this array will be removed of the critical css even if they are part of it. You can use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found