Using Bootstrap Colors In Js
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 fro
Solution 1:
This works if you're using Bootstrap 4:
const root = document.querySelector('html');
getComputedStyle(root).getPropertyValue('--danger');
You can access the CSS variables present in the :root pseudoelement
Post a Comment for "Using Bootstrap Colors In Js"