材质按钮更改禁用的按钮样式

如何使用主题在Material-UI中更改禁用按钮的样式?

以下code不起作用

const theme = createMuiTheme({
  props: {
    // Name of the component 
    MuiButtonBase: {
      // The default props to change
      disableRipple: true // No more ripple,on the whole application !
    }
  },overrides: {
    MuiButton: {
      text: {
        color: "red"
      },disabled: {
        text: {
          color: "blue"
        }
      }
    }
  }
});

function DefaultProps() {
  return (
    <ThemeProvider theme={theme}>
      <Button disabled>Change default props</Button>
    </ThemeProvider>
  );
}
yizhufu10 回答:材质按钮更改禁用的按钮样式

以下作品:

const theme = createMuiTheme({
  props: {
    // Name of the component 
    MuiButtonBase: {
      // The default props to change
      disableRipple: true // No more ripple,on the whole application !
    }
  },overrides: {
    MuiButton: {
      root: {
        color: "red",'&$disabled': {
           color: "blue"
       }
      },}
  }
});

Edit Invisible Backdrop

本文链接:https://www.f2er.com/3118473.html

大家都在问