by kj12345 · 15y ago · 0 comments
1) Use as few separate stylesheets site-wide as possible so any contradicting or repetitive rules will be obvious.
2) Use one line per rule so I can scan the selectors quickly, then scroll horizontally if necessary
3) I prefer complex comma-separated selectors which set one or two properties to simple selectors which set many properties. Grouping in this way gets me closer to having constants, e.g. a specific hex color won't be rewritten again and again, it will just follow a complex selector list.
4) Once a selector works, I try to make it more general, e.g. "div.info { font-size: 12px }" can probably just be ".info { font-size: 12px }". More general rules will apply in more cases, so fewer overall rules will be necessary.
I'm going to finally start turning off text wrap. You've opened my eyes to this. Thanks for sharing.