News for hackers. Stuff that matters.
Re:How to Manage CSS Explosion by beza1e1 on Thursday January 27, 2011 @07:03AM (#2147488)
My personal guidelines:

* Partition into sections for fonts, colors+images, positions+spacing, text, and specials.

* Refactor for minimal property duplication, instead of selectors. For example text-weight:bold; will be mentioned only once, but the "#content a" selector multiple times.

* Use a CSS reset.

* Make an extra file per browser+version for hacks. Do not use hacks, which make sure they get triggered in IE7, but not 6 or 8, for example, but use ie6.css, ie7.css, and ie8.css. Duplicate code for this if necessary.

Example: http://beza1e1.tuxen.de/style.css

There are no comments on this comment yet.