Global styles
@mantine/core
package includes some global styles that are required for components to work correctly.
If you override these styles, some components might not work as expected.
Global styles are automatically imported with:
CSS reset
@mantine/core
package includes minimal CSS reset – it includes only basic styles required for components to work
in modern browsers. If you need to support older browsers, you can additionally include normalize.css
or any other CSS reset of your choice.
Body and :root elements styles
@mantine/core
package includes the following body
and :root
elements styles:
Static classes
@mantine/core
package includes the following static classes:
mantine-active
– contains:active
stylesmantine-focus-auto
– contains:focus-visible
stylesmantine-focus-always
– contains:focus
stylesmantine-focus-never
– removes default browser focus ringmantine-visible-from-{breakpoint}
– shows element when screen width is greater than breakpoint, for examplemantine-visible-from-sm
mantine-hidden-from-{breakpoint}
– hides element when screen width is greater than breakpoint, for examplemantine-hidden-from-sm
You can use these classes with any components or elements:
Add global styles in your application
It is recommended to use CSS modules to apply styles to Mantine components
with className
prop or with Styles API. CSS modules files names usually
end with .module.css
, if you want to add global styles to your application, create a file with
.css
extension but without .module
part, for example global.css
.
In global .css
files you can reference all Mantine CSS variables and
change styles of <body />
, :root
and other elements. For example, to change body background-color: