@hitachivantara/uikit-react-core
Version:
UI Kit Core React components.
46 lines (45 loc) • 1.16 kB
JavaScript
import { createTheme } from "@mui/material/styles";
//#region src/providers/utils.ts
function createMuiTheme(theme) {
return createTheme({
colorSchemes: {
light: { palette: makePalette(theme.colors.light) },
dark: { palette: makePalette(theme.colors.dark) }
},
spacing: theme.space.base,
typography: { fontFamily: theme.fontFamily.body },
breakpoints: theme.breakpoints,
components: { MuiButtonBase: { defaultProps: {
disableRipple: true,
disableTouchRipple: true
} } }
});
}
function makePalette(colors) {
return {
primary: { main: colors.primary },
success: { main: colors.positive },
warning: { main: colors.warning },
error: { main: colors.negative },
info: { main: colors.info },
text: {
primary: colors.text,
secondary: colors.textSubtle,
disabled: colors.textDisabled
},
background: {
default: colors.bgPage,
paper: colors.bgContainer
},
divider: colors.border,
action: {
active: colors.primary,
hover: colors.primaryStrong,
selected: colors.primaryStrong,
disabled: colors.textDisabled,
disabledBackground: colors.bgDisabled
}
};
}
//#endregion
export { createMuiTheme };