我想在主题中添加一种命名的颜色,例如<p>Hello World</p>
warn
但是,material-ui会忽略此对象的import React from 'react'
import { MuiThemeProvider } from '@material-ui/core/styles'
import createMuiTheme from '@material-ui/core/styles/createMuiTheme'
const theme = createMuiTheme({
palette: {
primary: { main: '#30b5c8', warn: { main: '#000000' } },
secondary: { main: '#fadc35' },
warn: { main: '#ff9100', light: '#ffa733', dark: '#b26500' },
},
})
export default ({ children }) => {
return <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>
}
属性。是否可以添加此warn
?
color/property
的{{1}}一经渲染Material-ui
答案 0 :(得分:0)
您需要功能 createPalette ,您可以看到current working directory。遗憾的是,该功能没有公开,因此,您有两种方法可以执行所需的操作: