Founder of Skyward Digital, the UX Jamstack agency
Showing you how to:
๐ป Create excellent websites
๐ Evaluate and improve UX
๐งก Discover loyal users
๐จ๐ปโ๐ป he/him
Personally, i think CSS-in-JS is fine but you've got to be a lot more careful when writing it. Inline styling is very easy to use but too much of it makes the code very hard to read.
The biggest benefit i've seen from CSS-in-JS is very easy bundling so that when a page loads, you're loading as little as possible.
You can also do some mathematical equations/variable manipulation which is just impossible any other way. (with a template engine you might be able to do stuff inline, but it's horrible to do).
It's up to the developer to write it correctly and it's very easy to get wrong which makes it harder to read and code around. The benefits are great but it's by no means the only way to write css.
Another great alternative is using a Utility Class library - something like Tailwind, which almost entirely removes the need for writing your own css (but that is a very different approach).
Or you could just use classic css or scss and write a really well defined webpack file to handle bundling. The great thing is, we have loads of options now.
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.
Personally, i think CSS-in-JS is fine but you've got to be a lot more careful when writing it. Inline styling is very easy to use but too much of it makes the code very hard to read.
The biggest benefit i've seen from CSS-in-JS is very easy bundling so that when a page loads, you're loading as little as possible.
You can also do some mathematical equations/variable manipulation which is just impossible any other way. (with a template engine you might be able to do stuff inline, but it's horrible to do).
It's up to the developer to write it correctly and it's very easy to get wrong which makes it harder to read and code around. The benefits are great but it's by no means the only way to write css.
Another great alternative is using a Utility Class library - something like Tailwind, which almost entirely removes the need for writing your own css (but that is a very different approach).
Or you could just use classic css or scss and write a really well defined webpack file to handle bundling. The great thing is, we have loads of options now.