I'm trying to theme my site, which uses Bootstrap, by modifying the Bootstrap variables. Bootstrap defines some variables against the :root element, allowing me to override them in a straightforward way:
:root {
--bs-body-color: red;
}
However others are defined against selectors, such as --bs-navbar-color. In order to override this (and not worry about the specific selectors I need to specify), I need to apply the style universally:
:root * {
--bs-navbar-color: blue !important;
}
Is this considered bad practice? It seems to work, and although it might be considered a bad idea for regular styles, it seems to me that it's not too much of a problem when just dealing with CSS variables.