Here is Material-UI TextField style using withStyles from Material-UI itself:
export const STextField = withStyles({
root: {
background: 'white',
'& label.Mui-focused': {
color: 'white'
},
'& .MuiInput-underline:after': {
borderBottomColor: 'white'
},
'& .MuiOutlinedInput-root': {
'& fieldset': {
borderColor: 'white'
},
'&:hover fieldset': {
borderColor: 'white'
},
'&.Mui-focused fieldset': {
borderColor: 'white'
}
}
}
})(TextField);
and it works perfectly.
Is there any way to make the same style using styled-components?
I tried this:
export const STextField = styled(TextField)`
.MuiTextField-root {
background: 'white'
& label.Mui-focused: {
color: 'white'
},
& .MuiInput-underline:after: {
borderBottomColor: 'white'
},
& .MuiOutlinedInput-root: {
& fieldset: {
borderColor: 'white'
},
&:hover fieldset: {
borderColor: 'white'
},
&.Mui-focused fieldset: {
borderColor: 'white'
}
}
`;
but it is not making the same style.
I might be missing some extra syntax, any help appreciated!