I haven’t heard anyone yet argue you should apply these styles directly to HTML you author. The idea is you apply styles to elements through JavaScript.
That need to use JavaScript for everything kind of reminds me of jwz’s quip about regular expressions: “A programmer has a problem. He thinks: ‘I know, I’ll use JavaScript!’ He now has two problems.”
To be fair, this discussion is mostly taking place in the React community where they’re already using JavaScript to build UI components. In that context, there is a certain amount of sense to making the styles part of the JS component (just like JSX does for HTML.) Whether it’s ultimately a good idea… :shrugs:
I’ve been saying this for years, back in the days of server-generated HTML. If you’re using a programming language to generate HTML, that programming language is probably much better at consistently styling your elements than CSS is.
CSS is the worst of both worlds: it has the complexity of a programming language but not the power. It should go the way of XSLT.
That need to use JavaScript for everything kind of reminds me of jwz’s quip about regular expressions: “A programmer has a problem. He thinks: ‘I know, I’ll use JavaScript!’ He now has two problems.”
To be fair, this discussion is mostly taking place in the React community where they’re already using JavaScript to build UI components. In that context, there is a certain amount of sense to making the styles part of the JS component (just like JSX does for HTML.) Whether it’s ultimately a good idea… :shrugs:
Chris’s Shop Talk podcast also has a good episode on this subject which includes Nicole Sullivan and Jeremy Keith: http://shoptalkshow.com/episodes/180-panel-on-inline-styles/
I’ve been saying this for years, back in the days of server-generated HTML. If you’re using a programming language to generate HTML, that programming language is probably much better at consistently styling your elements than CSS is.
CSS is the worst of both worlds: it has the complexity of a programming language but not the power. It should go the way of XSLT.