Avoid conjecture with tools and testing

There have never been better and more accessible tools for testing CSS code before deployment. As such it's possible to supplant common performance generalizations with empirical facts. Performing tests provides actual data on which to base choices, rather than relying on mere conjecture.

To exemplify this, it has been a long-held belief that certain CSS selectors are 'slow' compared to others, the much maligned universal selector is an obvious example. Some would also argue that it would be better to use a qualified selector such as footer[role='contentinfo'] rather than merely [role='contentinfo']. The theory is that in the case of the latter, the selector engine has to travel every DOM node. However ...

Get Sass and Compass for Designers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.