-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Whitelisting doesn't keep a selector that ends in the html tag figure #39
Comments
It looks like the Thank you for reporting this, and sorry for the late response. We will look into this. |
@jsnanigans Ahh! So it has to match both. It would be really nice for it to work by matching the left most selector only, so you can easily whitelist everything under a particular selector. This would be really handy for when you're pulling in packages. The instance I had this problem is with magnific popup: https://github.com/dimsemenov/Magnific-Popup . They use a figure tag injected with javascript so it doesn't actually exist in my scanned files. While I could add the figure tag somewhere as an example, it would much easier to just Let me know if this is something that might be possible, or a feature you see as useful. Happy to try and help contribute as well if you can point me in the right direction :) |
It's not very intuitive, but purgecss breaks the selector into its peaces here so I would totally be for changing this, but i'm not sure how to best to it without breaking it for users who rely on the current behavior, if you want to have a crack at it, we would appreciate the help! |
Thanks for the explanation! Perhaps a config value for how the matching works to make it flexible could work. That way we wouldn't break current functionality. |
This is also my main issue with purgecss. One use case is that I'm using Smooch messaging platform and a while ago they stopped providing a script file that I can pass to purgecss in order for it to look at the selectors defined there. In my code I'm overriding their styles by using something like I could think of a solution where you would pass a list of objects into whitelistPatterns, this objects would have two properties, the pattern itself and a boolean to keep child selectors. We could keep the current functionality by checking if the element in the whitelistPatterns array is a string or an object. |
I'm having trouble with selector staying when I have it whitelisted. I tried diving into the code but I can't quite figure out where the bug might be. Is there a list of HTML tags that purgeCSS goes off that it only allows? I'm trying to figure out why
figure
tag isn't working properly. See below for an example:Whitelist:
CSS:
The text was updated successfully, but these errors were encountered: