I have toggle buttons that I want to have a different color scheme/theme from the default. Ideally, I would want to just be able to use the variants, but toggle buttons from react-bootstrap don't support using the variants the other buttons can. I tried following a solution I saw from here. While I have been able to get the color to change, I have not been able to get the active color to change at all.
const { state, dispatch } = useStateProvider();
const skills = state.sponsorManager.getSkillsForRankFromSponsor('f', state.sponsor);
const [checked, setChecked] = React.useState(false);
let skillCards = skills.map(v => (
<ToggleButton
className="untoggled-button"
id={v.id}
key={v.id}
value={v.id}
onClick={(e) => { console.log(e.currentTarget); setChecked(e.currentTarget.checked) }}
>
{v.displayName}
</ToggleButton>
));
return (
<div>
<ToggleButtonGroup type="checkbox">
{skillCards}
</ToggleButtonGroup>
</div>
)
App.css
.untoggled-button {
/* background-image: green !important; */
background-color: green !important;
color: white;
}
.untoggled-button.active {
background-color: red !important;
}