I've searched high and low for an answer, in both the docs and other SO questions.
I'm using the createMuiTheme
option in a separate JS file to override certain default styling, but am having a hard time understanding how the overrides
option works.
Currently my button looks like this:
The code I've got to get this far looks like this:
const theme = createMuiTheme({
...other code,
overrides: {
MuiFormControlLabel: {
focused: {
color: '#4A90E2'
}
},
MuiOutlinedInput: {
focused: {
border: '1px solid #4A90E2'
},
notchedOutline: {
border: '1px solid #4A90E2'
},
},
MuiFormLabel: {
focused: {
color: '1px solid #4A90E2'
}
}
}
)};
Then in my component, I'm using it as such:
import theme from './styles/ThemeStyles';
import { withStyles } from '@material-ui/core/styles';
class SignInForm extends Component {
render() {
const { classes } = this.props;
<form className={classes.container} noValidate autoComplete='off'>
<TextField
id="outlined-email-input"
label="Email"
className={classes.textField}
type="email"
name="email"
autoComplete="email"
margin="normal"
variant="outlined"
/>
</form>
}}
My question is, what am I missing to make my component look so funky? And in the future, how do I know what to target in the overrides
option of the ThemeProvider so that I don't run into similar situations?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…