I am using a Google-Chart and want to set the slice colors to the color used by bootstrap, e.g., for badge-success
or badge-danger
. Is there any way to access these color-codes from within JavaScript?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
This works if you're using Bootstrap 4:
You can access the CSS variables present in the :root pseudoelement
Another approach is...
Demo: https://www.codeply.com/go/GC96hjbf5v