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

Unused selectors not being removed, possibly related to escaped characters #118

Open
kylegach opened this issue May 1, 2016 · 3 comments

Comments

@kylegach
Copy link

kylegach commented May 1, 2016

I’m using a style system similar to Basscss, which can be seen here: https://github.com/kylegach/kylegach_com/tree/master/styles/modules.

A portion of my HTML can look like this:

<div class="left@md w-25@md px-2 px-3@sm pl-0@md pr-3@md">

And those px-2, px-3@sm, pl-0@md, and pr-3@md classes are defined in this stylesheet.

The purified CSS correctly strips all of the ...@lg classes, but it appears that all classes using @sm & @md are still included, because I used at least one class with either of those suffixes in the supplied content.

There are also many other unused selectors also not being removed that do not use escaped characters, e.g. .lineHeight-2, .display-none, .table, overflow-auto. I suspect this is because the following classes are used: lineHeight-3, display-none@md, overflow-hidden (I’m not sure how to explain the .table selector, except that I use <table>s in the HTML).

Is this a bug? Or is that simply the level of granularity for matching that is possible in Purify?

Thanks for your help. I’m happy to provide more information, if you let me know what you need.

@igidas
Copy link

igidas commented May 18, 2016

I'm using similar concept of class naming and also experiencing a lot of selectors not being removed, like:

.h-padA-default\@tablet { ... }
[ui-grid~="3/6@large"] { ... }
[ui-flex~="wrap:true"] { ... }

@sbacic
Copy link

sbacic commented Sep 30, 2016

Hey, I know that this is an old issue, but I've run into a similar problem and found the bug. Here's the merge request in case you're interested in a fix: #130.

Hope this helps somebody.

@ArmorDarks
Copy link

Same issue here...

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

No branches or pull requests

4 participants