Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

60
Vistas
My material UI custom classes are being overridden by material UI's default classes

I have a TextField whose label I want to be colored as black when it is focused. I added the classes to InputProps with that classes variable but unfortunately, it is being overridden by material UI's default styling in chrome dev tools. Here is the code. Please check the screenshot of chrome dev tools.

const useStyles = makeStyles((theme) => ({
inputLabelFocused: {
color: "black",
 },
}));

const classes = useStyles();

<TextField
      id="toDo"
      label="To Do"
      multiline
      rows={4}
      variant="filled"
      fullWidth
      InputLabelProps={{
        classes: {
          focused: classes.inputLabelFocused,
        },
      }}
    />

image of custom classes being overridden by default material UI classes in chrome dev tools

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

const useStyles = makeStyles({
  inputLabelFocused: {
    color: "black !important",
  },
});
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos