Skip to content

Commit

Permalink
[SnackbarContent] fix message text color with css var provider (#33285)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoWilhelm committed Jul 4, 2022
1 parent 04e1b1b commit 9ad8205
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SnackbarContentRoot = styled(Paper, {
return {
...theme.typography.body2,
color: theme.vars
? theme.vars.palette.text.primary
? theme.vars.palette.SnackbarContent.color
: theme.palette.getContrastText(backgroundColor),
backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
display: 'flex',
Expand Down
16 changes: 14 additions & 2 deletions packages/mui-material/src/styles/experimental_extendTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ export default function extendTheme(options = {}, ...args) {
setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.8));
const snackbarContentBackground = emphasize(palette.background.default, 0.8);
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
setColor(
palette.SnackbarContent,
'color',
lightPalette.getContrastText(snackbarContentBackground),
);
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-400'));
setColor(palette.StepContent, 'border', getCssVar('palette-grey-400'));
Expand Down Expand Up @@ -223,7 +229,13 @@ export default function extendTheme(options = {}, ...args) {
setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.98));
const snackbarContentBackground = emphasize(palette.background.default, 0.98);
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
setColor(
palette.SnackbarContent,
'color',
darkPalette.getContrastText(snackbarContentBackground),
);
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-600'));
setColor(palette.StepContent, 'border', getCssVar('palette-grey-600'));
Expand Down

0 comments on commit 9ad8205

Please sign in to comment.