简体   繁体   English

如何更改 Material UI 对话框边框的粗细和颜色?

[英]How do I change the weight and color of the border of the Material UI Dialog?

Hello I am trying to add an external frame to the Dialog Box from Material UI.您好,我正在尝试从 Material UI 向对话框添加外部框架。 I was trying to do this but nothing happened:我试图这样做,但什么也没发生:

overrides: {
  MuiDialog :{
    paper : { 
      borderWidth : 10,
      borderRadius: 10,
      borderColor : "#FFFFFF",
      backgroundColor : "#101010"
    }
}, .......

Do you know a way to do by using overrides in the MUI theme?您知道在 MUI 主题中使用覆盖的方法吗?

Thanks谢谢

The main issue I see is that you aren't setting border-style .我看到的主要问题是您没有设置border-style The following works:以下工作:

const theme = createMuiTheme({
  overrides: {
    MuiDialog: {
      paper: {
        borderWidth: 10,
        borderRadius: 10,
        borderColor: "#fff",
        borderStyle: "solid",
        backgroundColor: "#101010",
        color: "#fff"
      }
    }
  }
});

编辑材料演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Material UI:如何更改 Select 组件的边框颜色? - Material UI: How can I change the border color of the Select component? Material Ui TextField 如何改变边框的颜色 - Material Ui TextField how to change color of border 如何找到哪个 Material UI 默认主题 label 将更改默认边框颜色(不是焦点或 hover 边框)? - How do I find which Material UI default theme label will change the default border color (not focus or hover border)? 如何更改材质ui评级星星的边框颜色 - How to change border color of material ui Rating stars 如何更改 Material-UI 中单选按钮的边框颜色? - How to change border color of radio button in Material-UI? 在 Material UI 中,如何仅在用户输入文本后更改 TextField 的边框颜色? - In Material UI, how can I change the border color of the TextField only after the user enters text? 在材质UI TextField上悬停时更改边框颜色 - change border color on hover for Material UI TextField 材质 ui,如何更改自动完成文本字段的背景颜色、字体颜色、边框颜色 - material ui, how to change background color, font color, border color of autocomplete textfield 如何更改 material-ui 中选定 MenuItem 的文本颜色? - How do I change the text color of a selected MenuItem in material-ui? 如果反应/材质 ui 中需要道具,则更改 TextField 边框颜色 - Change TextField border color if props is required in a react/material ui
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM