At 03:12 PM 1/23/2006, Paul Kahl wrote:
>I'm constantly freaking out about reusability. I'm
>writing my first ASP.Net aps, and .Net code is heavy enough without having
>to load a 50k stylesheet on top of it.


Hmm, if your stylesheet is 50K that could indicate a problem in 
itself.  I would try to split it out into separate stylesheets for 
various pages or sections of the site, or optimize your approach to 
styling, or both.

Without seeing your work it's impossible to give specific advice, of 
course, but often it's possible to clean up markup & stylesheet by 
coding more sparely.  Rather than applying ids & classes so many 
elements, for example, rely more on each element's ancestry in the 
markup to provide the specificity you need.  Look for styling rules 
that share values in common and see if it makes sense to use a single 
rule for a group (a class!) of elements.

It's possible to go too far with this -- trimming file size isn't 
worth it if doing so makes the code more difficult for a human to 
read and maintain.  Scripting languages, after all, exist solely for 
us humans; the computers would be better off reading machine language.

If every page of your site has a unique 50K stylesheet, that's a 
problem, but if you're using one stylesheet for the entire site 
remember that it will be cached after the first download.

Good luck,

Paul 

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to