I've got a 50k main.css file that's referenced by a load of sites.
Each of these sites also has a site.css file that modifies certain
styles defined in main.css. Changing the colour of borders, boxes etc,
as well as defining certain site specific styles. site.css is small
and easy to understand, and the only bit that can be edited by the
masses.
That's the theory. The practice is that there are now 4 sites going
live
in a week where some muppet who claims to understand css has just
copied
main.css in chunks, renamed it site.css, tweaked some bits and added
more, without deleting the inherited styles (*nice full explanation
below). It all works fine, but it means each site's site.css is now
about 60k, when it's meant to be nice and neat and about 10/20k.
So, to the question:
What tools do people out there use that could help me? Is there any
tool that can compare declarations across multiple stylesheets to
prevent me from sitting down and laboriously going through every style
declaration in site.css to check if it's redundant or not? 4 times
over? I've had a look at Topstyle and it doesn't seem to perform this
function, which I find surprising. Am I being stupid?
diff/sed/awk etc aren't options, btw...(I ain't a unix god)
*Crystal clear explanation:
in main.css there is this statement:
A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:10px;
margin-left:7px;
padding-left:10px;
font-size:70%;
color:#fff;
background:url( arrow_white_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {color:#fff;}
In site.css there is this statement:
A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:0;
margin-left:7px;
padding-left:10px;
font-size:70%;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
site.css doesn't need those duplicate declarations, so that the
declaration in site.css *should* read:
A.backtotop:lin k, A.backtotop:vis ited {
margin-right:0;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
But, like, there's 240k of this stuff...
Each of these sites also has a site.css file that modifies certain
styles defined in main.css. Changing the colour of borders, boxes etc,
as well as defining certain site specific styles. site.css is small
and easy to understand, and the only bit that can be edited by the
masses.
That's the theory. The practice is that there are now 4 sites going
live
in a week where some muppet who claims to understand css has just
copied
main.css in chunks, renamed it site.css, tweaked some bits and added
more, without deleting the inherited styles (*nice full explanation
below). It all works fine, but it means each site's site.css is now
about 60k, when it's meant to be nice and neat and about 10/20k.
So, to the question:
What tools do people out there use that could help me? Is there any
tool that can compare declarations across multiple stylesheets to
prevent me from sitting down and laboriously going through every style
declaration in site.css to check if it's redundant or not? 4 times
over? I've had a look at Topstyle and it doesn't seem to perform this
function, which I find surprising. Am I being stupid?
diff/sed/awk etc aren't options, btw...(I ain't a unix god)
*Crystal clear explanation:
in main.css there is this statement:
A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:10px;
margin-left:7px;
padding-left:10px;
font-size:70%;
color:#fff;
background:url( arrow_white_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {color:#fff;}
In site.css there is this statement:
A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:0;
margin-left:7px;
padding-left:10px;
font-size:70%;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
site.css doesn't need those duplicate declarations, so that the
declaration in site.css *should* read:
A.backtotop:lin k, A.backtotop:vis ited {
margin-right:0;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
But, like, there's 240k of this stuff...
Comment