The problem I have with these CSS mini programs is that a 'dynamic' site might not always load the css on each page, unless under certain specific circumstances. i.e. what about ajax calls that result in a new div showing? or a responsive CSS file with media queries depending upon the size of the screen?
How about running it as a background to the website, over say, a month, at the end of which you'd have pretty good confidence that you'd have hit all paths.
Mincss "clears the junk out of your CSS"
21–30 of 52 posts
Re: Mincss "clears the junk out of your CSS"
#22Earlier quoted context omitted.
How about running it as a background to the website, over say, a month, at the end of which you'd have pretty good confidence that you'd have hit all paths.
This is an idea I am currently working on, similar to SitePoint's old "Dust Me Selectors" plugin for Firefox, but running in the background for all selected sites until a set amount of time or the user is happy that they have exhausted all dynamic functionality on the site.
Re: Mincss "clears the junk out of your CSS"
#23Re: Mincss "clears the junk out of your CSS"
#24Re: Mincss "clears the junk out of your CSS"
#25Earlier quoted context omitted.
How about running it as a background to the website, over say, a month, at the end of which you'd have pretty good confidence that you'd have hit all paths.
This is an idea I am currently working on, similar to SitePoint's old "Dust Me Selectors" plugin for Firefox, but running in the background for all selected sites until a set amount of time or the user is happy that they have exhausted all dynamic functionality on the site.
Re: Mincss "clears the junk out of your CSS"
#26Re: Mincss "clears the junk out of your CSS"
#27Managed to get 100kB of CSS down to about 2kB for the single-page site I was using it on.
Like the author here, I didn't get into exploring how to make this work effectively on a large site with a number of dynamic pages - the only thing I added for this type of approach was to provide a whitelist.
Re: Mincss "clears the junk out of your CSS"
#28Re: Mincss "clears the junk out of your CSS"
#29I've been looking for something like this, but with support for styles added using JavaScript. I have found anything yet, and it doesn't appear that this would do it either?
It also supports lists of HTML and CSS files to search through. It can perform login, find duplicates, list used rules as well as unused rules, as well as count how many times each rule is matched in the markup.
Requires Node, can be installed with npm.
Re: Mincss "clears the junk out of your CSS"
#30Very possible, some css rules are only used in 1 or 2 pages.