Hacker News new | past | comments | ask | show | jobs | submit login

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/




This might be right up your alley -- http://tachyons.io/ I also use a similar approach and thus love functional CSS :)


ID is faster than CLASS for the browser, especially when selecting by ID in Javascript.


But your HTML is uglier.


So? 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.


The 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.


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: