You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I had a need for this feature so I've implemented it and made a PR and completely forgot about it :) #210
Is your feature request related to a problem? Please describe.
At my current project we use PostCSS together with SCSS and the problem arises when we need to ignore lists of generated classes that will be used dynamically. There's to much to keep them in the whitelist array and existing ignore comments do not really cover our case easily.
If we use /* purgecss ignore */ before generated class then it doesn't work since the comment is left in the body of parent class:
and as you can see all the comments are left in the body of the parent class.
Describe the solution you'd like
I've added another ignore comment /* purgecss ignore current */ so that every class that has this comment inside is ignored.
Describe alternatives you've considered
There's obviously workarounds but they all either add overhead or another layer of redundant data/lists to maintain and potentially break things. The start/end comments also are left behind in parent body so they only will work if you use them at root level and that means basically ignoring the whole file in our case.
The text was updated successfully, but these errors were encountered:
n1kk
changed the title
Ignore class with a comment in it
[Feature] Ignore class with a comment in it
Sep 27, 2019
Hi, I had a need for this feature so I've implemented it and made a PR and completely forgot about it :) #210
Is your feature request related to a problem? Please describe.
At my current project we use PostCSS together with SCSS and the problem arises when we need to ignore lists of generated classes that will be used dynamically. There's to much to keep them in the whitelist array and existing ignore comments do not really cover our case easily.
If we use
/* purgecss ignore */
before generated class then it doesn't work since the comment is left in the body of parent class:turns to
and as you can see all the comments are left in the body of the parent class.
Describe the solution you'd like
I've added another ignore comment
/* purgecss ignore current */
so that every class that has this comment inside is ignored.turns to
Describe alternatives you've considered
There's obviously workarounds but they all either add overhead or another layer of redundant data/lists to maintain and potentially break things. The start/end comments also are left behind in parent body so they only will work if you use them at root level and that means basically ignoring the whole file in our case.
The text was updated successfully, but these errors were encountered: