我正在使用https://material-ui-next.com/,如下所示:
import React, { Component } from 'react';
import { AppBar, Toolbar } from 'material-ui';
import { Typography } from 'material-ui';
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
import {cyan, blue} from 'material-ui/colors';
const theme = createMuiTheme({
palette: {
primary:{
main:blue[900]
},
secondary: cyan,
},
});
class App extends Component {
render() {
return (
<MuiThemeProvider theme={theme}>
<AppBar position="static">
<Toolbar>
<Typography variant="title">
Hello
</Typography>
</Toolbar>
</AppBar>
</MuiThemeProvider>
);
}
}
export default App;
如您所见,我将主要主题更改为
main:blue[900]
但字体颜色是黑色。如何将字体颜色更改为白色?
查看https://material-ui-next.com/style/color/,字体颜色为白色。
字体颜色为黑色,但我想更改为白色。
答案 0 :(得分:1)
尝试将theme
对象更改为:
const theme = createMuiTheme({
palette: {
primary: {
main: blue[900]
},
text: {
primary: '#fff',
}
}
});