-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Getting ListItemText to inherit color is a pain #11834
Comments
You also have to add |
Ah, I hadn't even tried, I was just guessing. So it takes even more text to do. |
So I'm basically wishing we could add a |
@oliviertassinari at the very least it would be helpful to have |
If I understand correctly what you are looking for. This should work: <ListItemText classes={{ primary: 'your class' }} />
I have no objection to adding a |
@oliviertassinari but you're not open to a |
@oliviertassinari by the way, rendering <ListItemText disableTypography>
<Typography color="inherit">Test</Typography>
</ListItemText> It's not very elegant. We could check if the user passed in their own |
@jedwards1211 I think that it's too specific, the primary and secondary don't have the same color by default. Yeah, you can wrap the component. But I don't have a strong opinion about it. @mbrookes what do you think? |
It's a good point. We might even make this behavior the default, so people don't have to provide |
I agree with @oliviertassinari that If we added |
Okay. I wish there could be a <ListItem>
<PrimaryListItemText color="inherit">Primary</PrimaryListItemText>
<SecondaryListItemText>Secondary</SecondaryListItemText>
</ListItem> |
Expected Behavior
I wish it were this easy:
Current Behavior
I have to do:
This is a pain. I could create a wrapper component that inherits the color, but that would also be a pain. Most Material UI components make it nice and easy to inherit the color.
Context
I have a sidebar containing
<ListItems>
with a dark background, so I want all of the<ListItemText>
to be white, and it would be nice to be able to just inherit the white foreground color of the sidebar.Your Environment
The text was updated successfully, but these errors were encountered: