DEV Community

Discussion on: Global CSS with Material-UI Done Correctly in React Apps

Collapse
 
andersclark profile image
Anders Clark

Actually React's documentation clearly states they have no opinion of using JSS (but discourage inline styling )(reactjs.org/docs/faq-styling.html).
I don't know where jQuery comes in bu usually you just use Webpack to transform your dev-project into whatever shape or form you want your build to take: external CSS, one master-css etc.
In my opinion declaring CSS by ways of JSS does have some convenience to it in that it's neat to manipulate and use programmatically.

Thread Thread
 
johannblake profile image
Johann Blake • Edited

Embedding css into javascript is really only beneficial to individual developers or small teams. But on large projects where you have a dedicated UI/UX designer who is responsible for the app's styles, this becomes a headache. Most high end UI/UX designer tools come with built-in support for exporting their styles to css. A developer only needs to drop that into a folder and it will get used. In these kinds of projects, it is not the developer's responsibility to manage styles. Webpack does a nice job of importing css. But the Material-UI library doesn't use external css files.

Having external css files is just another extension of the so-called "separation of concerns" that developers employ within their software design. UI/UX designers are every much part of the continuous integration process as everyone else on the development team and a clean separation between the boundary dividing UI/UX development and code should be clearly identified in a team.