Skip to content

Commit

Permalink
Fixed blog intro
Browse files Browse the repository at this point in the history
  • Loading branch information
dance2die committed Jun 26, 2020
1 parent 918471e commit 05f6bc4
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ banner: ./images/featured-image.jpg
bannerCredit: "Image by [annca](https://pixabay.com/users/annca-1564471/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=2168521) from [Pixabay](https://pixabay.com/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=2168521)"
---

Adding a custom Material UI theme for Gatsby
Been searching for easy way to customize Material UI (MUI hereafter) theme and found few online tools to help me get it done quick.

Most of steps here are for configuring Gatsby for Material UI theme but a custom MUI theme set up is easy.


## 1. Bootstrap a new Gatsby site

Expand All @@ -34,10 +37,10 @@ npx gatsby new site-name-here

1. Go to the [Google's Material Design Color Tool site](https://material.io/resources/color)
1. Select primary & secondary colors and copy the current URL (, which updates on color selection)
![color tool](./images/color-tool-select-colors.png)
![color tool](https://sung.codes/static/bad736d2163940130efa7c04ec54c75c/17fa4/color-tool-select-colors.png "color tool")
1. Go to https://react-theming.github.io/create-mui-theme/ and paste the URL in `Paste URL here` input box
1. Now custom Theme JSON should be generated on the bottom right
![custom JSON](./images/custom-json.png)
![custom JSON](https://sung.codes/static/a54b2c9610f5ae1622570b82cab0f148/17fa4/custom-json.png "custom JSON")
## 4. Configure MUI theme
Expand Down Expand Up @@ -134,7 +137,7 @@ export default IndexPage

You will see that the `primary` and `secondary` colors are applied according to the custom theme.

![result](./images/result.png)
![result](https://sung.codes/static/4f4b24b0c6635d9d4504ef599276abc4/17fa4/result.png "result")

From here on, simply updating `./plugins/custom-mui-theme/theme/theme.json` should update the MUI theme

Expand Down

0 comments on commit 05f6bc4

Please sign in to comment.