nanobar icon indicating copy to clipboard operation
nanobar copied to clipboard

Is there a way to change color of progress bar via options in js?

Open camohub opened this issue 9 years ago • 5 comments

Hi, is it possible to change color of progress bar via

var nanobar = new Nanobar( { barCss: {'background-color': 'green'  } );

I dont want to have it in less file.

camohub avatar Aug 22 '16 12:08 camohub

No, it's not possible. But you can add a css line with javascript, nanobar is already doing that so you can use the same css tag:

const nanobar = new Nanobar()
const styleTag = document.getElementById('nanobarcss')
styleTag.innerHTML += '.nanobar .bar{background:#bdf;}'

jacoborus avatar Aug 23 '16 00:08 jacoborus

Can I ask you, why do you do it this way? Is it faster or what?

camohub avatar Aug 23 '16 06:08 camohub

I don't do it this way, I use css:

.nanobar .bar.errorbar {
  background: #e44;
}

jacoborus avatar Aug 23 '16 10:08 jacoborus

Of course, but if it would be in settings option it would be at one place. That's all.

camohub avatar Oct 13 '16 10:10 camohub

I had to use the following styling to style the nanobar progress bar correctly:

.nanobar .bar { background-color: #0074d9; }

oliveratgithub avatar Oct 28 '17 13:10 oliveratgithub