css in js

WHY CSS-IN-JS

  1. JavaScript enhances the capabilities of CSS (e.g. nesting, automatic vendor-prefixing, unit testing—depending on the library).
  2. Selectors are locally scoped, as CSS-in-JS libraries generate unique class names so that you don’t have to worry about specificity collision.
  3. You can achieve better performance, as CSS-in-JS only loads styles that are currently in use.

CSS in JS library

  1. STYLED COMPONENTS
  2. EMOTION
  3. JSS