hupe1980 / gatsby-theme-material-ui

Gatsby theme for Material-UI
MIT License
100 stars 42 forks source link

Customizing Theme not able to make it work and Inconsistency in Documentation / Examples #29

Closed meugeniatr closed 4 years ago

meugeniatr commented 4 years ago

Hello,

I am trying to be able to change the theme by using the documentation or examples but I see no changes.

In the documentation it says: Create & Edit src/gatsby-theme-material-ui-top-layout/theme.js

I have done this, and see no change to my theme.

I also check the examples and in the redux examples the theme is in another folder name: src/gatsby-theme-material-ui/theme.js

I also done this, and I am not able to see any changes.

Here is my theme.js:

import { createMuiTheme, colors } from '@material-ui/core'

const theme = createMuiTheme({
  palette: {
    primary: {
      main: `#556cd6`,
    },
    secondary: {
      main: `#19857b`,
    },
    error: {
      main: colors.red.A400,
    },
    background: {
      default: `#ddd`,
    },
  },
  typography: {
    fontFamily: ['Montserrat', 'sans-serif'].join(','),
  },
})

export default theme

And my config:

    {
      resolve: `gatsby-theme-material-ui`,
      options: {
        webFontsConfig: {
          fonts: {
            google: [
              {
                family: `Montserrat`,
                variants: [`300`, `400`, `500`],
              },
            ],
          },
        },
      },
    },

Do I miss a step ? Is there something to do to apply the theme over all material-ui components ?

Thank you,

hupe1980 commented 4 years ago

There is a bug in the redux example. #28 will fix it

oliviertassinari commented 4 years ago

@hupe1980 Should it be closed now that #28 is merged?

rejas commented 4 years ago

Looked at #28 and didnt see anything related to the READMEs changed in regard to that. Or am I missing something?

hupe1980 commented 4 years ago

I had to rename the directory:

examples/using-redux/src/gatsby-theme-material-ui/components/top-layout.js → examples/using-redux/src/gatsby-theme-material-ui-top-layout/components/top-layout.js

Now the example fits the README again