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

> Why I Write CSS in JavaScript

tl;dr because it's convenient.

It's also redundant, goes completely against the features of CSS (the cascading part), doesn't utilize the possibility of selectors, children, etc, ugly, and computationally heavy.

But yeah, why not.




Not to mention that it doesn't work without JavaScript enabled on the client (unless he's generating CSS in server-side JavaScript). That's fine for a true web app (and web apps do have their place), but it's completely not fine for a web page, which should display just fine without JavaScript.

People should not be forced to grant you permission to execute code in order to read text & view images.




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

Search: