material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

ListItem secondaryText color hardcoded?

Open beverlycodes opened this issue 10 years ago • 7 comments

I can't seem to get the secondary text in a ListItem to obey theming. When I switch to a dark theme, the text remains Black(54%), making it unreadable on a list item with a black background. I can work around this by applying a color style directly to an element within the secondaryText property, but I find I have to keep doing that to lists all over my app. For a lot of my lists, secondary text is coming from a variable and is just a string, making it tedious to have to wrap everything in unneeded div/p elements to fix the text color.

beverlycodes avatar Dec 12 '15 08:12 beverlycodes

@mbrookes. I'm working on this one and thinking of adding secondaryTextColor props. so is it a good way to solve this problem?

heetvachhani avatar Feb 09 '16 23:02 heetvachhani

@heetvachhani Better to add an elementStyle prop if it's needed, rather than an individual elementColor one. Just be aware of clashes with @newoga's work. I think he's almost done, but you might check if ListItem is complete before starting this.

mbrookes avatar Feb 10 '16 00:02 mbrookes

thanks for the suggestion @mbrookes, will implement secondaryTextStyle prop I guess it will solve the problem and I checked with @newoga and he's done with ListItem.

heetvachhani avatar Feb 10 '16 15:02 heetvachhani

@heetvachhani Fixed it.

oliviertassinari avatar Feb 27 '16 00:02 oliviertassinari

Any progress with making a secondaryTextStyle? In my case I would like to change css properties like fontSize and bottomBorder

danep93 avatar Dec 23 '16 18:12 danep93

Does the secondaryTextStyle exist? I couldn't find it when I was reading the code. @oliviertassinari

matthewfbenjamin avatar Aug 01 '17 18:08 matthewfbenjamin

Realized that I could just pass a span through. Might not be a bad idea to add a secondaryTextColor prop to be passed through to the ListItem though and set the code in the getStyles() function of the ListItem to be secondaryTextColor ? secondaryTextColor : listItem.secondaryTextColor

Thoughts? Can easily make the PR

matthewfbenjamin avatar Aug 02 '17 20:08 matthewfbenjamin