I am really struggling to find where this border color is defined. I have inspected the dom but see no border style in any of the input component nor its pseudo elements...
I simply want to lighten the color of the input border to match my theme disabled color.
Here is the code I used and the render.
<OutlinedInput
size='small'
disabled={disabled}
value={value}
endAdornment={<InputAdornment position="end">{ctx.user.currency.short}</InputAdornment>}
inputProps={{ style: { paddingBottom: 4, } }}
style={{ fontWeight: 700, fontSize: 18 }}
{...props}
/>
I have tried using <TextField /> but it has the same problem. Could you help me please ?

I have done this by using the theme palatte. I am using mui 5.5.0
import {createTheme} from "@mui/material";
const theme = createTheme({
palette: {
action: {
disabled: 'your color here e.g #000000',
}
},
});
By doing this, every disabled field through out the app will have the color defined in the palatte. And if you want to do this for a single/specific input field or you want to override this palatte disabled defined color. you can do it by following:
<TextField
value={value}
variant="outlined"
label="label"
disabled
sx={{
"& .MuiInputBase-root.Mui-disabled": {
"& > fieldset": {
borderColor: "your color here e.g #8cffcb"
}
}
}}
/>
i wanted to change border colour on active and focused states and i had to disable hover on disabled component i solved it like this.
renderInput={(params) => (
<TextField
sx={{
'& .MuiOutlinedInput-root': {
borderRadius: '7px',
height: 50,
border: '1px solid #909090',
':hover': {
border: '0.5px solid #fd0000 !important',
boxShadow: '-1px 1px 4px 4px #FFEAEA'
},
':focus-within': { border: '0.5px solid #fd0000 !important' }
},
'& .MuiOutlinedInput-root.Mui-disabled': {
':hover': {
border: '1px solid #909090 !important',
boxShadow: 'none'
}
},
'& .MuiOutlinedInput-notchedOutline': {
border: 'none'
}
}}
{...params}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With