Material UI: affect children based on class

后端 未结 1 685
醉酒成梦
醉酒成梦 2020-12-20 03:58

What I am trying to achieve

I have two classes - root and button - I want to affect button class on root state

相关标签:
1条回答
  • 2020-12-20 04:10

    Below is the correct syntax:

    const styles = {
      root: {
        "&:hover $button": {
          display: "block"
        }
      },
      button: {
        display: "none"
      }
    };
    

    Related answers and documentation:

    • jss-plugin-nested documentation
    • Using material ui createStyles
    • Advanced styling in material-ui
    0 讨论(0)
提交回复
热议问题