3 ms·
Semantic names for CSS classes have the same utility as good variable/function/method names in code. They describe what is this for, not how should it look. I h
by rimliu 10y ago
Semantic names for CSS classes have the same utility as good variable/function/method names in code. They describe what is this for, not how should it look. I have seen enough .red12px where it was green and 10 px already.
Cannot wait for the new web standards movement to start already.
- ryanbrunner 10y ago`.red12px` is for sure a bad example, but often-times "what is this for" in the context of a tag with a class on it is purely for styling. This div is here because I want padding here / a different font / whatever, and I can either be upfront about that (maybe with something a little more maintainable like `.padding-large` rather than `.padding-40px`), or I can do a little dance and invent some semantic name like `.widget-inner-details` that serves no purpose other than giving me a hook to say "I want larger padding here"