Peter Lindstrom
Aug 26, 2017 · 1 min read

The problem being “solved” by all these CSS/JS contraptions is that people don’t know how to use CSS classes properly.

You can make CSS rules as specific as they need to be, by adding classes for “scoping”. Two classes on one element is more specific than only one.

Matching for two classes under a higher-level class is more specific than matching for only one lower-level class. It’s not that complicated.

It seems all these devs have only used one class per element, and get frustrated when it matches other elements they didn’t want to match.

Then they figured the solution was to bring in JavaScript, to generate CSS class names that will only apply to one specific element. In other words, they’re using class names like identifiers. It’s highly silly.

)

    Peter Lindstrom

    Written by