fix: DatePicker calendar popup contrast in dark mode

## Changes
- Add global theme overrides for MUI DatePicker components (MuiPickersPopper,
  MuiDateCalendar, MuiPickersCalendarHeader, MuiDayCalendar, MuiPickersDay)
- Remove inline popper styling from CreateMaintenance component as it's now
  handled globally
- Calendar popup now properly adapts to both light and dark themes using
  theme palette tokens
This commit is contained in:
gorkem-bwl committed 2026-01-22 17:05:06 -05:00
1 parent ce322a8e28
commit e0e79fb0da
2 files changed
+52 -24

No files matched your search

+52
View File
@@ -687,6 +687,58 @@ const baseTheme = (palette) => ({
}),
},
},
// DatePicker calendar popup styling
MuiPickersPopper: {
styleOverrides: {
paper: ({ theme }) => ({
backgroundColor: theme.palette.primary.main,
}),
},
},
MuiDateCalendar: {
styleOverrides: {
root: ({ theme }) => ({
backgroundColor: theme.palette.primary.main,
}),
},
},
MuiPickersCalendarHeader: {
styleOverrides: {
root: ({ theme }) => ({
"& .MuiPickersCalendarHeader-label": {
color: theme.palette.primary.contrastText,
},
}),
},
},
MuiDayCalendar: {
styleOverrides: {
weekDayLabel: ({ theme }) => ({
color: theme.palette.primary.contrastTextTertiary,
}),
},
},
MuiPickersDay: {
styleOverrides: {
root: ({ theme }) => ({
color: theme.palette.primary.contrastText,
"&:hover": {
backgroundColor: theme.palette.tertiary.main,
},
"&.Mui-selected": {
backgroundColor: theme.palette.accent.main,
color: theme.palette.accent.contrastText,
"&:hover": {
backgroundColor: theme.palette.accent.main,
},
},
"&.Mui-disabled": {
color: theme.palette.primary.contrastTextTertiary,
opacity: 0.5,
},
}),
},
},
// code ends here.
// For labels of input fields