Stylefusion CSS is a zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build time.
Mantine 6 used CSS-in-JS and with the release of 7 they switched to CSS Modules. CSS Modules are great for small projects, but they don't offer the same benefits as CSS-in-JS. Such as:-
- Colocated styles
- Build time extraction of styles to CSS files
- Build time theme variables
- Includes the functions contained in postcss-preset-mantine
- Atomic css in production (will be finalised in future relase)
Stylefusion only supports Vite.
pnpm install @stylefusion/react
pnpm install --save-dev @stylefusion/vite-plugin
- fork non-native code from javascript to rust when react compiler replaces wyw-in-js.
- Extend build process to include styles param objects that use Emotion.
Stylefusion is a forked version of Pigment CSS.
All credits go to the original MUI team.