CSS Selectors are Conditional Statements

.foo {
}
Programmatically, is:
if (element has a class name of “foo") {
}
Descendent selectors are && logic and commas are ||. It just gets more complicated from there, with things like combinators and pseudo selectors. Just look at all the ways styles can cascade.
Jeremy Keith:
If you find you can’t select something in the CSS, that’s a sign that you probably need to add another class name to the HTML. The complexity is confined to …
The post CSS Selectors are Conditional Statements appeared first on CSS-Tricks.

Link: https://adactio.com/journal/14574