Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
camohub opened this issue Aug 22, 2016 · 5 comments
Open

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

camohub opened this issue Aug 22, 2016 · 5 comments

Comments

@camohub
Copy link

camohub commented Aug 22, 2016

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.

@jacoborus
Copy link
Owner

jacoborus commented Aug 23, 2016

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;}'

@camohub
Copy link
Author

camohub commented Aug 23, 2016

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

@jacoborus
Copy link
Owner

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

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

@camohub
Copy link
Author

camohub commented Oct 13, 2016

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

@oliveratgithub
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants