Improving Your CSS with Parker

Avatar of Robin Rendle
Robin Rendle on

📣 Freelancers, Developers, and Part-Time Agency Owners: Kickstart Your Own Digital Agency with UACADEMY Launch by UGURUS 📣

Harry Roberts has written about Parker, a stylesheet analysis tool by Katie Fenn. He explains why using tools like Parker are wonderfully helpful to developers:

I use Parker almost daily, and regularly go through it with my clients and workshop attendees. Parker surfaces some really interesting numbers, and if you know what they represent, you can draw some really valuable insights about your CSS from them.

Harry also describes a very important reason as to why developers might use lots of selectors per rule. So instead of containing styles within a single class, such as .btn { }, many developers often chain multiple selectors together, like .btn, .input[type="text"] {}, which tends to lead to unmaintainable code:

The surprisingly still-persistent fear and avoidance of judicious use of classes in our HTML often leads to developers creating (and subsequently maintaining) unwieldy lists of selectors that are all chained to the exact same declarations. By adopting a more class-based architecture, we can begin to recycle these rules in a much more terse and practical way.

Direct Link →