Skip to content

Commit

Permalink
[gatsby-plugin-nprogress] Pass plugin options on to NProgress.configu…
Browse files Browse the repository at this point in the history
…re() (#1941)

* Pass gatsby-plugin-nprogress options on to nprogress.configure()

* Optimistically update README
  • Loading branch information
fk authored and KyleAMathews committed Aug 28, 2017
1 parent 4766e63 commit 571bb13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gatsby-plugin-nprogress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ plugins: [
options: {
// Setting a color is optional.
color: `tomato`,
// Disable the loading spinner.
showSpinner: false,
}
}
]
```

In addition to `color` – a configuration option specific to
`gatsby-plugin-nprogress` that saves some time [customizing the nprogress CSS](https:/rstacruz/nprogress#customization) to match your site
colors – you may pass all available [nprogress configuration options](https:/rstacruz/nprogress#configuration).
1 change: 1 addition & 0 deletions packages/gatsby-plugin-nprogress/src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import NProgress from "nprogress"

exports.onClientEntry = (a, pluginOptions = { color: `#29d` }) => {
window.___emitter.on(`onDelayedLoadPageResources`, () => {
NProgress.configure(pluginOptions)
NProgress.start()
})
window.___emitter.on(`onPostLoadPageResources`, () => {
Expand Down

0 comments on commit 571bb13

Please sign in to comment.