Provide drop-in support for SSR using the material-ui library (v1-beta)
npm install --save gatsby-plugin-material-ui
Define your material-ui theme.
import createMuiTheme from 'material-ui/styles/createMuiTheme'
import purple from 'material-ui/colors/purple'
import green from 'material-ui/colors/green'
import red from 'material-ui/colors/red'
export default createMuiTheme({
palette: {
primary: purple,
secondary: green,
error: red,
},
})
And add the plugin to your gatsby-config.js
.
{
resolve: 'gatsby-plugin-material-ui',
options: {
pathToTheme: 'src/themes/default',
},
},