Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-25-2010, 01:33 PM   PM User | #1
mannix1959
New to the CF scene

 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mannix1959 is an unknown quantity at this point
CSS optimiser utility?

Let's say I have 2 stylesheets (sheet1.css & sheet2.css), used on different pages, that contain the following:

sheet1.css
.pop_bg{background:#fff;border:1px solid #000;}

sheet2.css
.div_bg{background:#fff;border:1px solid #000;}

Now, with copy&paste, I put these 2 sheets together in 1 sheet for all my pages (sheets_all.css)

sheets_all.css
.pop_bg{background:#fff;border:1px solid #000;}
.div_bg{background:#fff;border:1px solid #000;}

Does anyone know of a utility or an online service that can check sheets_all.css and say "Hey, classes pop_bg and div_bg are identical! Better remove one to reduce file size!"

I have found several css optimiser services through google, but none of them checks for duplicate classes.
mannix1959 is offline   Reply With Quote
Old 08-25-2010, 05:01 PM   PM User | #2
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Not sure if there is one. Did you try w3c css validator to see if there might be any errors?
teedoff is offline   Reply With Quote
Old 08-26-2010, 05:22 PM   PM User | #3
mannix1959
New to the CF scene

 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mannix1959 is an unknown quantity at this point
Yes, I did. No errors in the code.

http://www.cssoptimiser.com/ will turn

Code:
.pop_bg{background:#fff;border:1px solid #000}
.div_bg{background:#fff;border:1px solid #000}
into
Code:
.pop_bg,.div_bg{background:#fff;border:1px solid #000}
but it doesn't detect that div_bg and pop_bg are in fact copies of eachother.
It looks like there is no such utility available anywhere. I could write one myself, in php, if I wasn't facing a deadline. So, maybe in a next project.
mannix1959 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, optimiser

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:38 AM.


Advertisement
Log in to turn off these ads.