I am trying to create three on/off buttons to simulate difficulties easy, medium, and hard. I found some code online that already made some beautiful on/off buttons, imo, which I have tried to style. My problem is that I would like each button to have different colors when on (easy = $primaryGreen
, medium = $yellowish
, and hard = $primaryRed
). However, I can't seem to figure out to to apply this to each individual button. Only for all of them.
Currently my buttons look like this:
https://jsfiddle.net/dnk8acym/8/
I have tried to do stuff to this particular code:
input.toggle:checked + label:before {
background-color: $primaryGreen;
opacity: 0.5
}
input.toggle:checked + label:after {
background-color: $primaryGreen;
margin-left: calc(100% - 55px);
box-shadow: none;
}
Adding classes to each label, and adding the class to this CSS, but none of it worked.
So I was hoping for some help to how I go about solving this ?