When you inspect the element using your browser's developer tools, this is what you will see:
.btn-check:checked+.btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check)+.btn:active {
color: var(--custom-btn-active-color);
background-color: var(--custom-btn-active-bg);
border-color: var(--custom-btn-active-border-color);
}
The key part of the selector list here is .btn-check:checked+.btn
. This particular CSS rule targets an element with the class btn
that comes immediately after a checked element with the class btn-check
.
If you wish to make global changes to these colors, you can customize and override the variables by following this guide.
:root {
--custom-btn-active-color: purple;
--custom-btn-active-bg: purple;
--custom-btn-active-border-color: purple;
}
Keep in mind that the styles are applied to the labels rather than the input elements, as the inputs themselves are hidden using CSS.