Replies: 3 comments 5 replies
-
I don't know any workaround (apart from JavaScript). CSS custom properties are in our roadmap, but that'll take time. And since we released stable v5, we won't introduce breaking changes so we may not be able to do whatever we want. I have tons of ideas on the topic, just need time to draft them. |
Beta Was this translation helpful? Give feedback.
-
One way you could achieve it, would be to re-compile SCSS and cache it until further changes. If your project use PHP you can try this package: https://github.com/scssphp/scssphp But it would be great to use native CSS variables that we could dynamically change on the fly. |
Beta Was this translation helpful? Give feedback.
-
I've opened #34067 to get some ideas going to help with this. |
Beta Was this translation helpful? Give feedback.
-
Hi guys,
I need to change the "primary" color at run-time. At run-time, because I simply do not know the relevant color at compile time.
Reading your documentation about using CSS variables I feel like you guys have opened the door for exactly this purpose.
So I was hoping I could simply do the following (see the short snippet) and all components like alerts, buttons, badges etc. that apply "primary" switch to red (or whatever).
<style> :root{ --bs-primary: red; } </style> <button class='btn btn-primary'>Hello</button>
But this does not work. The button is still standard blue.
So, my question is: Is "changing colors at run-time" on your road map at all?
Thank you for the endless hours of work you put into v 5, guys!
Beta Was this translation helpful? Give feedback.
All reactions