Hacker News new | ask | show | jobs
by jokethrowaway 1994 days ago
Then you go back to HTML with attributes to control style, which is where we were before CSS.

It's good to have a level of separation between style and content. The problem with HTML and CSS is that often times you need to change your HTML to change the style of your application.

This is because HTML+CSS was meant to be for documents. It took ages to evolve into what we have today and it still has a lot of baggage. Designing apps with it is a hack which became mainstream.

If we want to improve the situation, I think we need a couple of standards to define application content and application style which can be compiled to HTML + CSS (as browsers are probably going to stay around for a bit longer).

Component based libraries (like react) are well placed to do something like this and it would help developers faced with this uneven separation of style, content and markup.

1 comments

I view the current Cambrian explosion of CSS-in-JS approaches as a distributed search for the “new standard”. Better to have 1000s of developers working on the problem then have 6 people on a committee make another bad, short-sited standard that becomes “cruft” in 4 years.

If you views React’s JSX as the “content” part of content/style break, then we’re not too far off. It compiles down to HTML :)