I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Most JS frameworks are going back to the days where we put php and html together and a file with everything mixed up! So it was natural that they wanted to put the css in there ...
Speaking as a web developer who likes to guarantee access for everyone, I think that processing styles with js is a waste of performance, battery and time!
The one exception to this, that I find great pleasure in using, is the approach used by Next.JS: styled-jsx. It is basically scoped style tags in the context of React components. It supports everything that you would expect from CSS as well: media queries, etc.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think that CSS in JS is almost always the wrong answer to a question nobody really asked.
Yes, we've lost something.
Exactly
Most JS frameworks are going back to the days where we put php and html together and a file with everything mixed up! So it was natural that they wanted to put the css in there ...
Speaking as a web developer who likes to guarantee access for everyone, I think that processing styles with js is a waste of performance, battery and time!
The one exception to this, that I find great pleasure in using, is the approach used by Next.JS: styled-jsx. It is basically scoped style tags in the context of React components. It supports everything that you would expect from CSS as well: media queries, etc.