I have a Material UI Select
component that is on a dark background, so for just this one component I'd like to change it so that the text and line colours are all white. The rest of the Select
instances should remain unchanged.
While I can get the text and icon to change colour, I can't seem to figure out how to use the classes
prop to set the underline colour. My attempts also seem to make the open icon wrap to the next line too. Here's an example demonstrating the problem:
I've set my style like this:
const styles = theme => ({
underline: {
borderBottom: '2px solid white',
'&:after': {
// The MUI source seems to use this but it doesn't work
borderBottom: '2px solid white',
},
}
};
Then I'm setting it like this:
<Select
classes={{
underline: classes.underline, // Does it go here?
}}
inputProps={{
classes: {
underline: classes.underline, // Or does it go here?
},
}}
>
This method does work for the text (not shown above, but in the linked example), it's just the underline colour that I can't get to change. What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…