This PR serves as a proof of concept of how we can build Material UI components using CSS modules, and then allow CSS in JS users to use all of the previously available APIs, like sx prop, styleOverrides etc. On the other hand, for people that care about performance or want to use plain CSS, they don't have to pay any penalty of bundle size or performance that comes from using CSS in JS.
CodeSandbox using only CSS modules: https://codesandbox.io/p/devbox/ssvrx2 (using the CSS modules only supported package @mui/styled-engine-noop - check vite.config.js)
This PR serves as a proof of concept of how we can build Material UI components using CSS modules, and then allow CSS in JS users to use all of the previously available APIs, like sx prop, styleOverrides etc. On the other hand, for people that care about performance or want to use plain CSS, they don't have to pay any penalty of bundle size or performance that comes from using CSS in JS.
CodeSandbox using Emotion: https://codesandbox.io/p/devbox/vite-react-forked-47ffsv (using the default @mui/styled-engine package)
CodeSandbox using only CSS modules: https://codesandbox.io/p/devbox/ssvrx2 (using the CSS modules only supported package @mui/styled-engine-noop - check vite.config.js)