JSS

JSS allows us to write CSS styles using JavaScript in a declarative way. This also means all the features of JavaScript are now available for writing CSS, making it possible to write reusable and maintainable styling code.

JSS works as a JS to CSS compiler that takes JS objects, where keys represent class names, with values representing corresponding CSS rules, and then generates the CSS along with scoped class names.

In this way, JSS generates unique class names by default when it compiles JSON representations to CSS, eliminating the chances of selector conflicts faced with external style sheets. Moreover, unlike inline styles, CSS rules defined with JSS can be shared across multiple elements and all CSS features can be used in the definitions. ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.