On Thu, 8 Jul 2010, Ellen Herzfeld wrote:

> Hello,
> 
> I am doing a make over of a large site. There is a lot of tweaking.
> 
> I use firebug and the webkit dev tools (and even the IE dev tools sometimes) 
> but I'm looking for something different.
> 
> When I go over my stylesheets to clean them up and organize them in a way 
> that's comprehensible to me at least, I sometimes wonder why I have this 
> rule. I use some classes and ids for the selectors when I can't figure out 
> how to do otherwise, but I mostly try to avoid having them all over the 
> place. When the stylesheet starts getting a bit long I find that the reason 
> for a rule isn't always totally obvious and it sometimes takes me a while to 
> remember or figure out where it is used. I also want to avoid putting 
> comments everywhere.
> 
> I would like a tool that takes a rule and goes through my pages and gives me 
> a report on where the rule is actually really used.
> 
> So if it isn't used anywhere anymore (most likely because I changed something 
> somewhere) I will be able to remove it safely.
> 
> Does this make sense? Does such a tool exist?

   There's a standard tool on *nix systems called grep.

   For example, searching for the class 'nav', this will print the
   line numbers as well as lines containinf it:

grep -n 'class=".*nav.*"' file.html

   I believe it can be installed on Windows systems.

-- 
   Chris F.A. Johnson, <http://cfajohnson.com>
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to