Open reboottime opened 1 year ago
For most cases, you can customize your component styling 1). via a list of properties provided by style-props 2). or the styles api on the component level
Or update the mantine built-in components at the global level via “MantineProvider”, for example
import { MantineProvider, Text } from '@mantine/core';
function App() {
return (
<MantineProvider
theme={{
components: {
Text: {
styles: {
root: { fontSize: '2rem' },
},
},
},
}}
withGlobalStyles
withNormalizeCSS
>
<Text>2rem text</Text>
</MantineProvider>
);
}
css in js
styled solution
Styled
_Styled
, for example
maintine-ComponentName-root
: represents the root element of that componentExample code
import { MantineProvider } from '@mantine/core';
function Demo() {
return (
<MantineProvider
withGlobalStyles
withNormalizeCSS
theme={{
colorScheme: 'dark',
colors: {
// override dark colors to change them for all components
dark: [
'#d5d7e0',
'#acaebf',
'#8c8fa3',
'#666980',
'#4d4f66',
'#34354a',
'#2b2c3d',
'#1d1e30',
'#0c0d21',
'#01010a',
],
},
}}
>
<App />
</MantineProvider>
);
}
to
property
Common Needs