View previous topic :: View next topic |
Author |
Message |
cokey Advocate


Joined: 23 Apr 2004 Posts: 3343
|
Posted: Fri May 26, 2006 1:28 pm Post subject: unused css |
|
|
I have reused an old stylesheet and significantly added to it, i was wondering if there is program or website that wil go through the css and tell me unused parts without me having to do it manually? Or maybe sed can do it (i have never used sed before). _________________ "Sex: breakfast of champions" - James Hunt |
|
Back to top |
|
 |
bunder Bodhisattva

Joined: 10 Apr 2004 Posts: 5479
|
Posted: Fri May 26, 2006 2:12 pm Post subject: Re: unused css |
|
|
cokehabit wrote: | I have reused an old stylesheet and significantly added to it, i was wondering if there is program or website that wil go through the css and tell me unused parts without me having to do it manually? Or maybe sed can do it (i have never used sed before). |
i would like one as well, i need to fix up my website. _________________ overlay | patches
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
|
|
Back to top |
|
 |
rezza Guru


Joined: 09 Apr 2003 Posts: 434 Location: Edinburgh, UK
|
Posted: Fri May 26, 2006 2:41 pm Post subject: |
|
|
Just do it by hand. If you are unsure of which parts are necessary then you are too shit at css to make websites, please turn off your computer and bang your head against the closest wall. If your css file is so big and complicated that the thought of doing it by hand makes you groan with despair, then your site design sucks like a 5 dollar crack whore and you need to start afresh. _________________ screenshots
blog |
|
Back to top |
|
 |
bunder Bodhisattva

Joined: 10 Apr 2004 Posts: 5479
|
Posted: Fri May 26, 2006 2:46 pm Post subject: |
|
|
rezza wrote: | If your css file is so big and complicated that the thought of doing it by hand makes you groan with despair, then your site design sucks like a 5 dollar crack whore and you need to start afresh. |
you're right, it does.
i didn't do it and i barely know html.  _________________ overlay | patches
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
|
|
Back to top |
|
 |
gen2fox Guru


Joined: 25 May 2004 Posts: 544
|
Posted: Fri May 26, 2006 4:40 pm Post subject: Re: unused css |
|
|
cokehabit wrote: | I have reused an old stylesheet and significantly added to it, i was wondering if there is program or website that wil go through the css and tell me unused parts without me having to do it manually? Or maybe sed can do it (i have never used sed before). |
How is such a program supposed to work? For example, a CSS class may not be used on the frontpage but used somewhere else deeper in the site, I suggest you clean up the code using this site then remove unwanted parts by hand.
Edit: The CSS cleanup service I linked to is based on CSS Tidy, a command-line CSS cleanup utility. _________________ python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
blog |
|
Back to top |
|
 |
Shadow Skill Veteran

Joined: 04 Dec 2004 Posts: 1023
|
Posted: Fri May 26, 2006 9:50 pm Post subject: |
|
|
I would guess that it could look for stuff in the child pages that references css classes, if no references are found then it would return a 1 for unused, otherwise it would return 0 and the appropriate line number(s.) _________________ Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.
"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it." |
|
Back to top |
|
 |
cokey Advocate


Joined: 23 Apr 2004 Posts: 3343
|
Posted: Fri May 26, 2006 11:44 pm Post subject: |
|
|
rezza wrote: | Just do it by hand. If you are unsure of which parts are necessary then you are too shit at css to make websites, please turn off your computer and bang your head against the closest wall. If your css file is so big and complicated that the thought of doing it by hand makes you groan with despair, then your site design sucks like a 5 dollar crack whore and you need to start afresh. | I based it on a previous site with 2 different style sheets, i modified both and created a third, 2 are of average size and the other is very long.
The truth is that it is too long ago written to remember from memory and i'm not that fucking stupid to go through pages and pages writing down which ones are still in use. The problems happened when i converted some of the content to php and it is too much of a mess.
Also i'm too fucking lazy  _________________ "Sex: breakfast of champions" - James Hunt |
|
Back to top |
|
 |
cokey Advocate


Joined: 23 Apr 2004 Posts: 3343
|
Posted: Fri May 26, 2006 11:49 pm Post subject: |
|
|
also i was thinking that a sed script could browse through 2 sheets (one being html and the other css) and output all the same values (names here) which i would have in one file and then to it to other to have a list of ones used. I'm not talking about table or heading values i'm talking about named classes where the names have changed because i've just used another name to be lazy rather that going through and changing it.. _________________ "Sex: breakfast of champions" - James Hunt |
|
Back to top |
|
 |
Tasslehoff Tux's lil' helper


Joined: 09 Jul 2003 Posts: 100 Location: BC Canada
|
Posted: Sat May 27, 2006 12:37 am Post subject: |
|
|
Not much help now but it works well to comment in your stylesheet so that you know later wtf different bits do. To comment in CSS files you use this style:
/* I am a comment */
as I said not much help to you now though |
|
Back to top |
|
 |
cokey Advocate


Joined: 23 Apr 2004 Posts: 3343
|
Posted: Sat May 27, 2006 12:47 am Post subject: |
|
|
Tasslehoff wrote: | Not much help now but it works well to comment in your stylesheet so that you know later wtf different bits do. To comment in CSS files you use this style:
/* I am a comment */
as I said not much help to you now though | i do that _________________ "Sex: breakfast of champions" - James Hunt |
|
Back to top |
|
 |
|