Bootstrap defines its colors using CSS variables prefixed with --bs-. The primary color is controlled by --bs-primary. Overriding this variable changes the primary color throughout the theme.
:root {
/* Your code here */
}CSS variables must be declared inside a selector block like :root with a colon : separating the name and value. Option A correctly places the variable inside :root with proper syntax.
:root {
--bs-primary: #28a745;
}
<button class="btn btn-primary">Click me</button>Overriding --bs-primary to #28a745 changes the primary button's background color to green. The button uses this variable for its styling.
--bs-alert-bg?alert on their container elements.The correct selector for Bootstrap alerts is the class .alert. Option B uses this class selector properly to apply the custom background color.
Dark backgrounds require light text for readability. Setting the button text color to white ensures sufficient contrast and accessibility compliance.
