loading...

Discussion on: Classical CSS vs CSS in JavaScript

Collapse
9zemian5 profile image
Oleksandr Demian

Vue.js and Svelte3 allows you to have scoped classical CSS inside of components.

Collapse
korbraan profile image
Cédric Rémond

In Angular too, and the absence of component scoped CSS in React is the only reason that would push me to use CSS-in-JS.

Thread Thread
9zemian5 profile image
Oleksandr Demian

Yeah, React is all about Javascript (JSX, CSS IN JS).

Thread Thread
korbraan profile image
Cédric Rémond

Not really, CSS in JS is a community addition to react. By default there is only raw unscoped CSS if I'm not missing anything.

Thread Thread
supportic profile image
Supportic

You can configure webpack to handle [.regex].css files as scoped.
In Create-React-App it's default if you name it .module.css that it's scoped.