4 ms·
I'm a huge fan of 1 & 2, so I end up using CSS with only class names. This helped me deliver maintainable and reliable stylesheets that other devs like. Most
by drinchev 9y ago
I'm a huge fan of 1 & 2, so I end up using CSS with only class names.
This helped me deliver maintainable and reliable stylesheets that other devs like.
Most importantly using only class names you will gain :
1. Your HTML / CSS is easier to maintain.
2. Is faster to develop.
3. Is faster to refactor.
4. Is more portable.
5. Is faster for the browser.
I even wrote a blog post about it [1].
http://www.drinchev.com/blog/css-with-only-class-names/ http://www.drinchev.com/blog/css-with-only-class-names/
- abhirag 9y agoThis might be right up your alley -- http://tachyons.io/ http://tachyons.io/ I also use a similar approach and thus love functional CSS :)
- wvenable 9y agoBut your HTML is uglier.
- naasking 9y agoSo? The only people looking at your html classes are you and your team. Bots don't process css, and most people don't look at html.
- wvenable 9y agoThe same people looking and working on the CSS are the same people looking and working on the HTML. HTML full of long complex class names is a bit harder to grok. I actually prefer nice semantic HTML but I admit that's not always possible.
- naasking 9y ago> HTML full of long complex class names is a bit harder to grok. I wouldn't recommend long and complex names either, but with something like tachyons, they're not long or complex, there are simply long lists of orthogonal classes.
- mozumder 9y agoID is faster than CLASS for the browser, especially when selecting by ID in Javascript.