|
From: fleemo17 on 10 Jan 2008 15:42 Over the course of building a very large site, I've wound up with an enormous style sheet containing plenty of superfluous styles. Is there a tool that can recognize which styles are not being used in a site and eliminate them? Can Dreamweaver perform that function?
From: dorayme on 10 Jan 2008 15:55 In article <ebbc6d43-7f36-4a9e-a40f-524cdd3b1d05(a)t1g2000pra.googlegroups.com >, fleemo17(a)comcast.net wrote: > Over the course of building a very large site, I've wound up with an > enormous style sheet containing plenty of superfluous styles. Is there > a tool that can recognize which styles are not being used in a site > and eliminate them? Can Dreamweaver perform that function? I will just tell you one method I use: you see .class in the css and wonder if it is being used. So use the Search and Replace function in your text editor and search the whole set of html docs for (to take the simplest case) class="class". If it #id you are wondering about, search for (again, to take the simplest case), id="id" There are more complicated searches that you might need to make and a familiarity with GREP functions would assist you. But you *can* get by mostly without. For example, if you suspect you have muliple classes specified in your page like class="class1 class2" then you can simply search for "class1 and then search later for class1" and then later "class2 and then class2". If you suspect a triple class and you need to capture the middle one, well there is always simply class. -- dorayme
From: fleemo17 on 10 Jan 2008 18:24 Thanks for the response, dorayme. Yeah, I was hopin' there'd be an easier solution than performing a search for each individual class and id. Like I said, this style sheet has gotten huge over time, so it's going to be a laborious task. :\
From: dorayme on 10 Jan 2008 18:48 In article <a756d712-d126-47d4-ad5e-8d5761d6e9cd(a)v4g2000hsf.googlegroups.com >, fleemo17(a)comcast.net wrote: > Thanks for the response, dorayme. Yeah, I was hopin' there'd be an > easier solution than performing a search for each individual class and > id. Like I said, this style sheet has gotten huge over time, so it's > going to be a laborious task. :\ I guess it depends on how big your project is. The actual global Find functions work in less than the time you can say, "O hells bells, I have been making this site up as I go without sufficient strategic planning" <g> You can also use intuition and guess work. On this, here is a further strategy I recommend: The extra classes and things that do no work in the css might do no harm. So you have time on your side. So comment out anything you even suspect is a cog that is not engaged with any machinary. And browse away on your local machine or server and if nothing ever shows up wrong you ever notice after a few days or weeks, dump the cog. (btw... Please try to quote the gist of the thread before replying as many folk here do not use Google to read newsgroups and some of us have online readers that dump old posts). -- dorayme
From: GTalbot on 10 Jan 2008 20:06 On 10 jan, 15:42, fleem...(a)comcast.net wrote: > Over the course of building a very large site, I've wound up with an > enormous style sheet containing plenty of superfluous styles. Most of the time, beginners at CSS do not understand what is inheritance and how to use it. Also, instead of relying and using default and initial values of CSS properties, they tend to reset them and often, this is unneeded, unnecessary. I can recommend: Writing Efficient CSS http://developer.mozilla.org/en/docs/Writing_Efficient_CSS especially the Rely on inheritance section > Is there > a tool that can recognize which styles are not being used in a site > and eliminate them? No, I don't think there is such a tool. CSSTidy may be good at fixing certain types of coding habits or weaknesses but it won't be able to optimize CSS code and figure out what is already default and initial values and what is, according to the document DOM tree, what is inherited and what needs to be overriden. Regards, Gérard -- Internet Explorer 7 bugs http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
|
Next
|
Last
Pages: 1 2 Prev: looking for an example page w/ image thumbnails + different aspect ratios Next: Spacing |