MIND BLOWN?
CSS
CSS in JS
Scoped by default.
Shadow DOM.
Argument: Complex systems like BEM are there to manage scoping.
Not taking the power of css away from you!
Anything that is possible in CSS is possible in CSS in JS
Object format
Tagged template Literal (ES6)
CSS class name style
CSS was never designed for this.
No need of naming.
Tree shaking available.
Browser compatibility.
Across technology compatibility
Auto pre-fixer , css loader, css pre- processors not needed.
Even global styles available.
SSR is also supported.
New learning curve.
No default props option available
Makes unit testing a bit difficult as the class names are dynamic
Before:
After:
Cross-Platform swiggy design components library.