Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
39 lines
784 B
TypeScript
39 lines
784 B
TypeScript
import Checkbox from '@mui/material/Checkbox';
|
|
import { createTheme, ThemeProvider, styled } from '@mui/material/styles';
|
|
import { orange } from '@mui/material/colors';
|
|
|
|
declare module '@mui/material/styles' {
|
|
interface Theme {
|
|
status: {
|
|
danger: string;
|
|
};
|
|
}
|
|
// allow configuration using `createTheme()`
|
|
interface ThemeOptions {
|
|
status?: {
|
|
danger?: string;
|
|
};
|
|
}
|
|
}
|
|
|
|
const CustomCheckbox = styled(Checkbox)(({ theme }) => ({
|
|
color: theme.status.danger,
|
|
'&.Mui-checked': {
|
|
color: theme.status.danger,
|
|
},
|
|
}));
|
|
|
|
const theme = createTheme({
|
|
status: {
|
|
danger: orange[500],
|
|
},
|
|
});
|
|
|
|
export default function CustomStyles() {
|
|
return (
|
|
<ThemeProvider theme={theme}>
|
|
<CustomCheckbox defaultChecked />
|
|
</ThemeProvider>
|
|
);
|
|
}
|