Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unused css
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
Butts McCokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3327

PostPosted: Fri May 26, 2006 1:28 pm    Post subject: unused css Reply with quote

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).
_________________
Since the bible and the church are obviously mistaken about where we came from, how can we trust them with where we're going?

"An eye for an eye will make us all blind" - Gandhi

Cold is gods way to tell us to burn more Catholics
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5213

PostPosted: Fri May 26, 2006 2:12 pm    Post subject: Re: unused css Reply with quote

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.
_________________
goodbye fgo. it was nice knowing you.
Back to top
View user's profile Send private message
rezza
Guru
Guru


Joined: 09 Apr 2003
Posts: 434
Location: Edinburgh, UK

PostPosted: Fri May 26, 2006 2:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5213

PostPosted: Fri May 26, 2006 2:46 pm    Post subject: Reply with quote

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. :lol:

i didn't do it and i barely know html. :oops:
_________________
goodbye fgo. it was nice knowing you.
Back to top
View user's profile Send private message
gen2fox
Guru
Guru


Joined: 25 May 2004
Posts: 544

PostPosted: Fri May 26, 2006 4:40 pm    Post subject: Re: unused css Reply with quote

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
View user's profile Send private message
Shadow Skill
Veteran
Veteran


Joined: 04 Dec 2004
Posts: 1023

PostPosted: Fri May 26, 2006 9:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Butts McCokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3327

PostPosted: Fri May 26, 2006 11:44 pm    Post subject: Reply with quote

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 :wink:
_________________
Since the bible and the church are obviously mistaken about where we came from, how can we trust them with where we're going?

"An eye for an eye will make us all blind" - Gandhi

Cold is gods way to tell us to burn more Catholics
Back to top
View user's profile Send private message
Butts McCokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3327

PostPosted: Fri May 26, 2006 11:49 pm    Post subject: Reply with quote

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..
_________________
Since the bible and the church are obviously mistaken about where we came from, how can we trust them with where we're going?

"An eye for an eye will make us all blind" - Gandhi

Cold is gods way to tell us to burn more Catholics
Back to top
View user's profile Send private message
Tasslehoff
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2003
Posts: 100
Location: BC Canada

PostPosted: Sat May 27, 2006 12:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Butts McCokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3327

PostPosted: Sat May 27, 2006 12:47 am    Post subject: Reply with quote

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
_________________
Since the bible and the church are obviously mistaken about where we came from, how can we trust them with where we're going?

"An eye for an eye will make us all blind" - Gandhi

Cold is gods way to tell us to burn more Catholics
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum