views:

41

answers:

1

Is there a way of filtering large CSS files for the only required selectors on a page, and creating css files that contain just these selectors?

Case: I have a very large CSS file that I want to filter on a per page basis, so that the file size is cut down and can be cached by mobile devices. I was thinking along the lines of something like a server side dust me selectors tool.

The particular project I am working on is using ASP.NET MVC.

Thanks

A: 

Heads up that while you might get smaller individual page loads, the overall load of browsing the site will be higher given that you're hitting the server each and every time for a new CSS file (rather than just caching a site-level CSS file once).

In addition, if you find that there are a lot of unique per-page CSS declarations, the CSS for the site may not be written very well. So the solution may be to go back and rethink the CSS structure to begin with, perhaps looking into OOCSS models:

http://wiki.github.com/stubbornella/oocss/

Unfortunately, none of that answers your specific question.

DA
good advice, I'd love to rewrite all the css but time is a factor too, thanks!
Dr. Frankenstein