Classical Design
by in CodeSOD on 2024-04-17There is a surprising amount of debate about how to use CSS classes. The correct side of this debate argues that we should use classes to describe what the content is, what role it serves in our UI; i.e., a section of a page displaying employee information might be classed employee
. If we want the "name" field of an employee to have a red underline, we might write a rule like:
.employee .name { text-decoration: underline red; }