3 ms·
> My example takes 8LOC of customization. Yours use 45LOC. That matches my experience with customizing styles on larger project, Chakra is 80% simpler to custom
by shripadk 6y ago
> My example takes 8LOC of customization. Yours use 45LOC. That matches my experience with customizing styles on larger project, Chakra is 80% simpler to customize.
Since your contention was the LOC and ability to use nested CSS styles, I have taken your own example and matched it. Line to line. Using Material UI. Updated the above demo:
https://codesandbox.io/s/material-demo-d2vmn?file=/demo.js:176-394 https://codesandbox.io/s/material-demo-d2vmn?file=/demo.js:1...
8 LOC of customization. Same styles you applied to your demo with a few syntactic changes.
Hope this convinces you that you can do exactly the same thing in Material UI as you can in Chakra. Because both use CSS-in-JS. What you can't do in Chakra is ability to change styles of nested components (note I am saying components instead of HTML elements) without worrying about implementation detail.