Usage with Sass
This guide will explain how to use Sass in combination with
postcss-preset-mantine. Note that examples on mantine.dev website
use only postcss-preset-mantine
– you will need to modify them to use with Sass.
Sass modules
You can use Sass modules the same way as CSS modules:
- Use
*.module.scss
/*.module.sass
extension for your files to enable modules - Use
*.scss
/*.sass
extension for global styles
Usage with Vite
Install sass
:
Add mantine resources in your vite.config.js
file:
Create src/_mantine.scss
file:
All done! you can now use breakpoint variables, rem
function, hover
, light
/dark
mixins:
Usage with Next.js
Install sass
:
Add mantine resources in your next.config.mjs
file:
Create _mantine.scss
file in the root folder of your project:
All done! you can now use breakpoint variables, rem
function, hover
, light
/dark
mixins: