background preloader

DRY

Facebook Twitter

DRY CSS: Don’t Repeat Your CSS. A few weeks ago in the comments on my post about css formatting, Brett and David pointed me to a couple of articles and a presentation I hadn’t yet seen.

DRY CSS: Don’t Repeat Your CSS

All had interesting ideas about css practices and I thought I would offer some of my thoughts on them. One of the articles, Don’t use IDs in CSS selectors? , makes the argument for using classes over IDs as css styling hooks. Since I covered another article with similar of arguments I won’t cover Oli’s article here, but would recommend you give it a read. In this post I want to talk about a presentation Brett pointed me to. CSS Dry Principle. The DRY (Don’t Repeat Yourself) principle is a software design theory that stresses the importance of not duplicating code. Every software programmer these days uses a variety of design principles and design patterns in their day to day programming tasks.

It helps them improve the quality, performance and maintainability of the software system by avoiding code redundancy. Other useful CSS articles: We have to alert schools, banks, insurance companies, doctors, friends, etc. DRY CSS talk (slides and audio) Don't repeat yourself. Applying DRY[edit] DRY vs WET solutions[edit] Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either "write everything twice" or "we enjoy typing".[2][3] See also[edit]

Don't repeat yourself

DRY CSS talk (slides and audio)