-
Notifications
You must be signed in to change notification settings - Fork 35
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
Can it remove unused css? Just like uncss. #329
Comments
No it can not. If you have What I do on my sites is that I have One feature I'm interested in but haven't had time to implement is...
I'd love for someone to step up and write that. It's probably just a matter of using I can help with the stuff around it if someone can find a Something you'd be interested in attempting @lmrwork ? |
I’m aware of rules removal from original styles, because of side effects. For instance, suppose we have .foo { ... } /* not used in critical path, so it will not aded to c.css */
.bar { ... } /* used in critical path, goes to c.css */ Note that If you inject /* c.css */
.bar { ... }
/* a.css */
.foo { ... }
.bar { ... } /* yeah, that’s duplicate */ All work as intended ( However, if you subtract rules used in /* c.css */
.bar { ... }
/* a.css */
.foo { ... } And now |
@lahmatiy But what if you inject the new
You'd end up with a DOM that looks something like this: <head>
<title>My Page</title>
<link rel=stylsheet href=a.css>
<link rel=stylesheet href=b.css>
<style>{{ content of c.css }}</style>
... That way, you'd ultimately end up with: /* a.css */
.foo { ... }
/* c.css */
.bar { ... } |
@peterbe Just change the order of |
Ok. I can see that if I think about it. Darn it! Somewhat related I came to the same conclusion if attempting to find a combined minimal CSS from two different URLs that have either different DOMs or different CSSs or both different. Still, let's get back on track. I can definitely see some useful use cases of finding out which selectors were not in the minimal CSS. For example, if you might help you find blocks of CSS in your originals that are never needed. Kinda like Chrome's coverage report. You could do something like this:
Now, if you pretty-print that BLOAT.css you can open it and see what's not used and you can start inspecting it manually. |
Can it remove unused css? Just like uncss.
The text was updated successfully, but these errors were encountered: