From 47de5b3f214b4a1760ba15073cc939c5b1394b3a Mon Sep 17 00:00:00 2001 From: Anastasios Selalmazidis Date: Sat, 4 Apr 2020 10:51:39 +0300 Subject: [PATCH] :star: add(css_varriables): Add variables for bar height and color --- css/nprogress.css | 50 ++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/css/nprogress.css b/css/nprogress.css index 6752d7f..dda3c1c 100644 --- a/css/nprogress.css +++ b/css/nprogress.css @@ -1,36 +1,41 @@ +:root { + --bar-color: #29d; + --bar-height: 2px; +} + /* Make clicks pass-through */ + #nprogress { pointer-events: none; } #nprogress .bar { - background: #29d; - + background: var(--bar-color); position: fixed; z-index: 1031; top: 0; left: 0; - width: 100%; - height: 2px; + height: var(--bar-height); } /* Fancy blur effect */ + #nprogress .peg { display: block; position: absolute; right: 0px; width: 100px; height: 100%; - box-shadow: 0 0 10px #29d, 0 0 5px #29d; + box-shadow: 0 0 10px var(--bar-color), 0 0 5px var(--bar-color); opacity: 1.0; - -webkit-transform: rotate(3deg) translate(0px, -4px); - -ms-transform: rotate(3deg) translate(0px, -4px); - transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); } /* Remove these to get rid of the spinner */ + #nprogress .spinner { display: block; position: fixed; @@ -43,14 +48,12 @@ width: 18px; height: 18px; box-sizing: border-box; - border: solid 2px transparent; - border-top-color: #29d; - border-left-color: #29d; + border-top-color: var(--bar-color); + border-left-color: var(--bar-color); border-radius: 50%; - -webkit-animation: nprogress-spinner 400ms linear infinite; - animation: nprogress-spinner 400ms linear infinite; + animation: nprogress-spinner 400ms linear infinite; } .nprogress-custom-parent { @@ -58,17 +61,24 @@ position: relative; } -.nprogress-custom-parent #nprogress .spinner, -.nprogress-custom-parent #nprogress .bar { +.nprogress-custom-parent #nprogress .spinner, .nprogress-custom-parent #nprogress .bar { position: absolute; } @-webkit-keyframes nprogress-spinner { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); } + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } } + @keyframes nprogress-spinner { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } } -