Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Special Interests > Web Design and Development
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 19, 2005, 12:52 PM   #1
DesignIt
macrumors member
 
Join Date: Aug 2005
CSS program question?

Does anybody know of a program that will go thru a style sheet and remove any unused styles?

That would be a helpful program.
__________________
1.67GHz 15" PowerBook w/SuperDrive
DesignIt is offline   Reply With Quote
Old Dec 19, 2005, 02:59 PM   #2
mnkeybsness
macrumors 68030
 
mnkeybsness's Avatar
 
Join Date: Jun 2001
Location: Moneyapolis, Minnesota
Send a message via AIM to mnkeybsness
How would it know what is used and what is not?

A good stylesheet should only be written to include styles that are used on your pages and your layout should reuse styles as needed so that you don't end up with 4 classes that do the same thing.

It's all a matter of planning.
__________________
Scribbls - a collaborative drawing community designed to combine drawings into outcomes—no talent required.
mnkeybsness is offline   Reply With Quote
Old Dec 19, 2005, 03:29 PM   #3
munkle
macrumors 68030
 
munkle's Avatar
 
Join Date: Aug 2004
Location: On a jet plane
Of course ideally that would be the case but a lot of sites (especially blogs) aren't built from scratch by people knowledgeable in CSS but hacked from a pre-supplied template...I may or may not be speaking from experience
munkle is offline   Reply With Quote
Old Dec 19, 2005, 04:03 PM   #4
floyde
macrumors 6502a
 
floyde's Avatar
 
Join Date: Apr 2005
Location: Monterrey, México
Quote:
Originally Posted by mnkeybsness
How would it know what is used and what is not?
It could read the whole HTML looking for the "class" or "id" (on divs) attributes, and then it could match it to the CSS stylesheet. I haven't heard of such a program though.
__________________
"He who will not reason is a bigot; he who cannot is a fool; and he who dares not is a slave."
floyde is offline   Reply With Quote
Old Dec 19, 2005, 04:23 PM   #5
Josh
macrumors 68000
 
Josh's Avatar
 
Join Date: Mar 2004
Location: Stockbridge, MI
Send a message via AIM to Josh Send a message via Yahoo to Josh
You could set up a simple shell script that would search for (using grep) all instances of <div id="*"> and <div class="*"> within the HTML file, then have it replace <div id="*"> with #*, and <div class="*"> with .*, and save that as a new document.

Then you'd pretty much just have to compare the two on your own. The script could search for common instances, but it would have no idea of knowing what is a propery and what is a name, so you'd be left with only the names of the ids and classes. I guess that could then be used to help you know which ones are safe to delete, though.
__________________
JoshuaEStevens.com
"Many go fishing all their lives without knowing that it is not fish they are after." - Thoreau
Josh is offline   Reply With Quote

Reply

Mac Forums > Special Interests > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:16 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC