I'm using a CDN to import Bootstrap 5 CSS. Bootstrap contains a bunch of different root CSS variables that are used by the components.
Here is my code:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" />
<style>
:root {
--bs-primary: red;
}
</style>
<button class="btn btn-primary">
i should be red but im not
</button>
I was assuming that this would apply the --bs-primary color to all of the bootstrap components, but it doesn't. I've tried placing the custom var declaration above the CDN link, and even adding !important. Nothing seems to work.
According to the docs I should be able to do this. Why doesn't it work?