Problem
Trying to change the background color of a radio input that's been styled like a button so that when the user clicks on it, the color will change from grey to yellow.
Code snippet
/*----------------------------------
SIDEBAR
----------------------------------*/
input[type=radio],
input[type=checkbox] {
display: none;
}
form input[type="radio"]:checked + label {
background-color: yellow;
}
label {
display: block;
appearance: button;
-webkit-appearance: button;
-moz-appearance: button;
-ms-appearance: button;
font-family: 'Roboto', sans-serif;
font-weight: 400;
background: #DDDDDD;
font-size: 1.6rem;
color: #111111;
border: 2px solid #AAAAAA;
padding: 8px;
width: 40%;
margin: 0 auto;
text-align: center;
&: hover {
cursor: pointer;
}
&: checked {
background-color: $yellow;
}
}
<form>
<label for="">
<input type="radio" class="button" id="Male" name="gender">Male</input>
</label>
<label for="">
<input type="radio" class="button" id="Female" name="gender">Female</input>
</label>
</form>