-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Alert] Fix square
Paper prop
#30027
[Alert] Fix square
Paper prop
#30027
Conversation
@material-ui/core: parsed: +Infinity% , gzip: +Infinity% |
Thanks for your contribution. As you already mentioned, changing the default border radius to 0px is a breaking change, so I'd not go for it. I think the following change is sufficient. diff --git a/packages/mui-material/src/Alert/Alert.js b/packages/mui-material/src/Alert/Alert.js
index 436d710c26..a362390b69 100644
--- a/packages/mui-material/src/Alert/Alert.js
+++ b/packages/mui-material/src/Alert/Alert.js
@@ -47,7 +47,7 @@ const AlertRoot = styled(Paper, {
return {
...theme.typography.body2,
- borderRadius: theme.shape.borderRadius,
+ borderRadius: ownerState.square ? 0 : theme.shape.borderRadius,
backgroundColor: 'transparent',
display: 'flex',
padding: '6px 16px',
@@ -147,7 +147,6 @@ const Alert = React.forwardRef(function Alert(inProps, ref) {
return (
<AlertRoot
role={role}
- square
elevation={0}
ownerState={ownerState}
className={clsx(classes.root, className)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look clear to me, they are not breaking, so all is good from my side. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!! :)
Related to #28193, #29726 , #29288 and #30014
By default, we have square prop passed to
Alert
component. See:https://github.com/mui-org/material-ui/blob/22c34014eeba310cefab4c93005ec9959dc51a96/packages/mui-material/src/Alert/Alert.js#L148-L150
But due to borderRadius styling in Alert component the rounded corners were still enabled. I am not sure whether we want or not want rounded corners by default in Alert.
I concluded by the code that rounded corners should be off. But then I guess it would be a breaking change now. (Argos may fail).
If developers want to enable rounded corners, now they will have to instead explicitly do:
Let me know if want to it the other way by keeping the rounded corners to avoid breaking change. Like we have it now.
Edit: Kept rounded corners by default.