材料ui:如何增加MuiModal-root z-index?

问题描述 投票:0回答:1

默认情况下,z-index设置为1300

做类似的事情:

[class*='MuiModal-root'] {
  z-index: 2000!important;
}

有效,但有更好的方法吗?

reactjs material-ui
1个回答
1
投票

如果你没有一个Material-UI themes docs并覆盖z-index,那就创建一个主题:

export const theme = createMuiTheme({
    overrides: {
        MuiModal:{
            root: {
                zIndex: 2000,
            }
        }
    }
});
© www.soinside.com 2019 - 2024. All rights reserved.