Friday, July 03, 2009

Writing Efficient CSS for use in the Mozilla UI - MDC

This is a very interesting article about the dos and donts of writing CSS. While it applies to CSS used in Mozilla user interface app, the rules do amke sense for ordinary CSS uses. avoid using tag rules like DIV { }, avoid descendent rules like DIV DIV {}. Use children rules if you have to. Use IDs because they are faster than classes and much faster than tag names. Keep your right most element in the rule very specific etc.

Writing Efficient CSS for use in the Mozilla UI - MDC: "How the Style System Matches Rules
The style system matches a rule by starting with the rightmost selector and moving to the left through the rule's selectors. As long as your little subtree continues to check out, the style system will continue moving to the left until it either matches the rule or bails out because of a mismatch."

No comments: