如何在Material UI主题中设置默认html元素的样式

时间:2020-04-22 19:28:21

标签: material-ui

可能是重复的,但是在必须将类应用于它们之前,我陷入了使用Material UI主题为a标签等元素设置默认样式的方式上的困惑。

我尝试了各种解决方案,包括尝试在@globals属性中进行设置,例如:

const theme = createMuiTheme({
    palette: {
        primary: {
            main: '#000000'
        },
        background: {
            default: grey[50],
        },
    },
    typography: {
        fontFamily: [
            '"Open Sans"',
            'sans-serif',
            '"Helvetica Neue"',
            '-apple-system'
        ].join(',')
    },
    overrides: {
        MuiAppBar: {
            colorPrimary: {
                backgroundColor: grey[50]
            },
            colorSecondary: {
                main: '#000000'
            },
            root: {
                borderBottom: `1px solid ${grey[300]}`
            }
        }
    },
    '@global': {
        a: {
            textDecoration: 'none'
        }
    }
});

0 个答案:

没有答案