B
B
budda6742021-04-15 10:04:23
React
budda674, 2021-04-15 10:04:23

How to change color of material ui component element in react?

I'm trying to change the color of the svg arrow and underline text on hover, I just can't figure out how to change the default style.
Codesandbox

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-04-15
@budda674

const ThemedInput = withStyles((theme) => ({
  root: {
    "&:hover": {
      "&$underline": {
        "&::before": {
          borderColor: theme.palette.primary.dark
        }
      }
    }
  },
  input: {
    fontWeight: 700,
    color: theme.palette.primary.main
  },
  underline: {
    "&::before": {
      borderColor: theme.palette.primary.main
    }
  }
}))(Input);

const ThemedSelect = withStyles((theme) => ({
  select: {
    "&:hover": {
      "& ~ $icon": {
        color: theme.palette.primary.dark
      }
    }
  },
  icon: {}
}))(Select);

<ThemedSelect input={<ThemedInput />}></ThemedSelect>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question