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

Feature request: ignore everything between starting and closing comment #66

Closed
benface opened this issue Mar 17, 2018 · 3 comments
Closed

Comments

@benface
Copy link
Contributor

benface commented Mar 17, 2018

The current whitelisting features are great, but I think the "CSS comment" one could be improved. Instead of just ignoring one selector/ruleset at a time, I think it should ignore everything between two comments, like this:

/* purgecss start ignore */
h1 {
    color: blue;
}
h2 {
    color: red;
}
/* purgecss end ignore */

It would make it much easier to ignore large parts of the CSS (even whole files) that you are 100% sure you want to keep even if PurgeCSS can't find the mentioned classes/elements in the markup, because they are added dynamically with JavaScript for instance.

@jsnanigans
Copy link
Member

Great Idea! thanks

@gisu
Copy link

gisu commented Apr 11, 2018

👍

@Ffloriel
Copy link
Member

This feature has been added with the released version 1.0.0.
I'll now close this issue, let me know if something does not work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants