Purgecss: `:not` selector missing in 2.x

Created on 6 Apr 2020  路  9Comments  路  Source: FullHuman/purgecss

Originally reported in https://github.com/FullHuman/purgecss/issues/293#issuecomment-593420415

When reporting a bug, please try to include the following:

  • [ ] A descriptive title
  • [ ] An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
  • [ ] What package and version you're using, and the platform(s) you're running it on: [email protected], [email protected]

When you open an issue for a feature request, please add as much detail as possible:

  • [ ] A descriptive title
  • [ ] A description of the problem you're trying to solve, including why you think this is a problem
  • [ ] An overview of the suggested solution
  • [ ] If the feature changes current behavior, reasons why your solution is better
.full-news a[href*="//"]:not([href^="mpc-hc.org"]):not([href*="trac.mpc-hc.org"])::after,
.new a[href*="//"]:not([href^="mpc-hc.org"]):not([href*="trac.mpc-hc.org"])::after {
    content: "\f08e"; /* fa-external-link */
    display: inline-block;
    font-family: FontAwesome;
    margin-left: 0.3em;
}

If change the code to this then it's kept with the new version

.full-news a:not([href*="mpc-hc.org"])::after,
.new a:not([href*="mpc-hc.org"])::after {
    content: "\f08e"; /* fa-external-link */
    display: inline-block;
    font-family: FontAwesome;
    margin-left: 0.3em;
}
bug

Most helpful comment

this one seems to be failing for me as well

:not(pre) > code {
  @apply text-sm text-red-600 bg-gray-100 p-1 rounded
}

All 9 comments

this one seems to be failing for me as well

:not(pre) > code {
  @apply text-sm text-red-600 bg-gray-100 p-1 rounded
}

is the issue still present? I'm not able to reproduce it. Do you have a repo to reproduce this issue by any chance?

The repo I hit the issue isn't maintained anymore plus I made the workaround I mentioned, but you can find it here https://github.com/mpc-hc/mpc-hc.org

The issue seems to be with the content. The content doesn't explicitly have a[href*="//"] and a[href*="//"]. But <a href="{{ page.next.url }}".

PurgeCSS is not able to understand that page.next.url is equal to any values. So href*="//" is not perceived as being present.

Sorry, you are wrong. You are looking at the source files and not the dist files.

The issue is reproducible when you try to use this package in React project https://github.com/jamesmfriedman/rmwc/tree/master/src/list : no cursor: pointer above active list items.

@XhmikosR, ah yes, you're right. I was looking at the source. The dist files have a similar issue though.
<a href=/2017/03/06/1.7.11-released/. Links seems to be all relative, so they don't contain //

@pahan35 I'll give it a try and let you know

I'll add your package 1.6.0 into my repo https://github.com/pahan35/web-ui-boilerplate with RMWC into a separate branch and then upgrade to 3.0.0 to reproduce this bug. I'll ping this thread in when I do it (in a week or two).

Or feel free to do it yourself faster, if you have time for it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chuckyblack picture chuckyblack  路  3Comments

TylerBarnes picture TylerBarnes  路  5Comments

knowler picture knowler  路  3Comments

simllll picture simllll  路  3Comments

joneldiablo picture joneldiablo  路  6Comments