Skip to content

Commit

Permalink
[Alert] Use getContrastText for filled variant font color (#29813)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamoraMabuya committed Jun 22, 2022
1 parent b145133 commit 67ec02d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mui-material/src/Alert/Alert.js
Expand Up @@ -70,7 +70,9 @@ const AlertRoot = styled(Paper, {
}),
...(color &&
ownerState.variant === 'filled' && {
color: '#fff',
color: theme.palette.getContrastText(
theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
),
fontWeight: theme.typography.fontWeightMedium,
backgroundColor:
theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
Expand Down

0 comments on commit 67ec02d

Please sign in to comment.