【问题标题】:Remove Margin Top of The MuiInput right after a label在标签后立即删除 MuiInput 的边距顶部
【发布时间】:2022-11-02 00:45:08
【问题描述】:

我想从createTheme将标签后输入的边距默认设置为0,这是来自MUI的CSS。因为它开始于标签,我不知道我应该编辑哪个组件。任何帮助,将不胜感激!

【问题讨论】:

    标签: material-ui


    【解决方案1】:

    像这样覆盖MuiInputLabel 的样式:

    const theme = createTheme({
      components: {
        MuiInputLabel: {
          styleOverrides: {
            root: {
              "& +.MuiInputBase-root": {
                marginTop: 0
              }
            }
          }
        }
      }
    });
    

    【讨论】:

      猜你喜欢
      • 2015-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多