forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
GlobalThemeOverrideSx.js
45 lines (43 loc) · 1.06 KB
/
GlobalThemeOverrideSx.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import * as React from 'react';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Chip from '@mui/material/Chip';
import Check from '@mui/icons-material/Check';
const finalTheme = createTheme({
components: {
MuiChip: {
styleOverrides: {
root: ({ theme }) =>
theme.unstable_sx({
// https://mui.com/system/getting-started/the-sx-prop/#spacing
px: 1,
py: 0.25,
// https://mui.com/system/borders/#border-radius
borderRadius: 1, // 4px as default.
}),
label: {
padding: 'initial',
},
icon: ({ theme }) =>
theme.unstable_sx({
mr: 0.5,
ml: '-2px',
}),
},
},
},
});
export default function GlobalThemeOverride() {
return (
<ThemeProvider theme={finalTheme}>
<Chip
color="success"
label={
<span>
<b>Status:</b> Completed
</span>
}
icon={<Check fontSize="small" />}
/>
</ThemeProvider>
);
}