diff --git a/readme.md b/readme.md index 22b049c..9d16c85 100644 --- a/readme.md +++ b/readme.md @@ -27,5 +27,8 @@ InertiaProgress.init({ // Whether the NProgress spinner will be shown. showSpinner: false, + + // The height of the progress bar. + height : '2px', }) ``` diff --git a/src/progress.js b/src/progress.js index 8bda399..daf90ab 100644 --- a/src/progress.js +++ b/src/progress.js @@ -32,7 +32,7 @@ function finish(event) { } } -function injectCSS(color) { +function injectCSS(color,height) { const element = document.createElement('style') element.type = 'text/css' element.textContent = ` @@ -49,7 +49,7 @@ function injectCSS(color) { left: 0; width: 100%; - height: 2px; + height: ${height}; } #nprogress .peg { @@ -111,11 +111,11 @@ function injectCSS(color) { } const Progress = { - init({ delay = 250, color = '#29d', includeCSS = true, showSpinner = false } = {}) { + init({ delay = 250, color = '#29d', includeCSS = true, showSpinner = false ,height = '2px'} = {}) { addEventListeners(delay) NProgress.configure({ showSpinner }) if (includeCSS) { - injectCSS(color) + injectCSS(color,height) } }, }