I am building a react app and using material ui for styling. I have a select field with <FormControl>
in as below:
<FormControl
size="small"
style={{ width: "320px" }}
variant="outlined"
className={classes.formControl}
>
<InputLabel className={classes.inputlabel} id="demo-simple-select-outlined-label">Gender</InputLabel>
<Select
className={classes.select}
labelId="demo-simple-select-outlined-label"
id="demo-simple-select-outlined"
value={gender}
onChange={handleGender}
label="Gender"
>
<MenuItem value="">
<em>None</em>
</MenuItem>
<MenuItem value="Male">Male</MenuItem>
<MenuItem value="Female">Female</MenuItem>
<MenuItem value="Other">Other</MenuItem>
</Select>
</FormControl>
and after rendering it looks like this:
I can't change the border color of this select element. I have searched about customizing the select field in material ui but I still couldn't change the border color. The border color should be #9fef00.
Edit: The classes I've used for styling the select field are as follows:
const useStyles = makeStyles((theme) => ({
inputlabel: {
color: "#9fef00",
"&.Mui-focused": {
color: "#9fef00",
},},
select: {
color: "#9fef00",
"&:before": {
borderColor: "red"
},
},
formControl: {
"& .MuiInput-underline:hover:not(.Mui-disabled):before": {
borderColor: "red"
}
},
}));