-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
customization: themeHigher level theming customizability.Higher level theming customizability.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUI
Description
Issue
If the theme defaultProps.slotProps defines className and style, they are replaced by the component's slotProps:
// src/theme.ts
const theme = createTheme({
components: {
MuiCardHeader: {
defaultProps: {
slotProps: {
title: {
className: "text-sm",
style: {
color: "red",
},
},
},
},
},
},
});
<ThemeProvider theme={theme}>
<CardHeader
slotProps={{
title: { className: 'text-red-500', style: { background: 'blue' } },
}}
/>
</ThemeProvider>The className and style from the theme are replaced by the slotProps on the component instance.
Expected
Based on the above snippet, the CardHeader should have className text-sm text-red-500 and the style color: 'red', background: 'blue'.
Use case
When using Material UI together and Tailwind CSS together.
Metadata
Metadata
Assignees
Labels
customization: themeHigher level theming customizability.Higher level theming customizability.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUI
Projects
Status
Done