首页 > 解决方案 > 使用 createMuiTheme 更改 Material UI 的 H1

问题描述

我在使用材料 UI 创建自定义主题后,但不能像我想要的那样针对主题的各个部分:

const theme = createMuiTheme({
  palette: {
    primary: {
      main: '#556cd6',
      fontFamily: '"Indie Flower", handwriting',
    },
    secondary: {
      main: '#19857b',
    },
    error: {
      main: red.A400,
    },
    background: {
      default: '#fff',
    },
  },
  typography: {
    // Use the system font instead of the default Roboto font.
    h1: {
      fontFamily: '"Indie Flower", handwriting',
    },
  },
})

您是否可以更改默认字体h1,h2,input,p等内容?

标签: javascriptcssmaterial-designmaterial-ui

解决方案


推荐阅读