Skip to content

Instantly share code, notes, and snippets.

@Robin-bob
Last active November 18, 2016 00:43
Show Gist options
  • Save Robin-bob/c1df95ab8bdba90aedde8d2df6a70179 to your computer and use it in GitHub Desktop.
Save Robin-bob/c1df95ab8bdba90aedde8d2df6a70179 to your computer and use it in GitHub Desktop.
radio-button custom
.questions-form__block-radio {
position: relative;
margin-bottom: 18px;
input {
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
bottom: 0;
cursor: pointer;
& + label {
&:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
border: solid 2px #2d3b4e;
background-color: transparent;
transition: background-color .2s, border-color .2s;
border-radius: 50%;
}
&:after {
content: '';
background: url('check.svg') center no-repeat;
width: 20px;
height: 20px;
background-size: 8px 6px;
transform: scale(.1);
opacity: 0;
transition: transform .2s, opacity .2s;
position: absolute;
top: 0;
left: 0;
z-index: 2;
border-radius: 50%;
}
}
&:checked {
& + label {
&:before {
background-color: #6ae2a6;
border-color: #6ae2a6;
}
&:after {
opacity: 1;
transform: scale(1);
}
}
}
}
label {
font-size: 15px;
color: #2d3b4e;
padding-left: 36px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment