-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[List] Add support for list item container style overrides #25777
Conversation
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.
In #13597 we discuss changing the structure. Basically, it's not OK to change the root dynamically (since v1). It's magical. Does taking this issue into account, and more specifically the flattening direction change the outcome of this PR?
I mean, was:
diff --git a/packages/material-ui/src/ListItem/ListItem.js b/packages/material-ui/src/ListItem/ListItem.js
index d06a7edc18..ae25d6df7b 100644
--- a/packages/material-ui/src/ListItem/ListItem.js
+++ b/packages/material-ui/src/ListItem/ListItem.js
@@ -151,7 +151,7 @@ const ListItemContainer = experimentalStyled(
{
name: 'MuiListItem',
slot: 'Container',
- overridesResolver,
+ overridesResolver: (props, styles) => styles.container,
},
)({
position: 'relative',
considered as an option for the solution?
I haven't thought of this, mainly because it kind of validates the CSS structure that I had in mind. My thinking was that it is unintuitive to define styles in a component that is a child of another. On the other hand, we won't have breaking changes with the proposed fix, plus it doesn't require the developers to have knowledge of the internal structure of the component. Let me update. |
This PR adds the support for adding style overrides for the container inside the
ListItem
.Also fixes #25774