Skip to content

Instantly share code, notes, and snippets.

@atomrli
Created February 15, 2018 17:16
Show Gist options
  • Select an option

  • Save atomrli/dff8adadccae85b0951d25cc53827322 to your computer and use it in GitHub Desktop.

Select an option

Save atomrli/dff8adadccae85b0951d25cc53827322 to your computer and use it in GitHub Desktop.
radio btn style
.radio {
position: absolute;
z-index: -1;
opacity: 0;
margin: 10px 0 0 7px;
}
.radio + label {
position: relative;
padding: 0 0 0 35px;
cursor: pointer;
}
.radio + label:before {
content: '';
position: absolute;
top: -3px;
left: 0;
width: 22px;
height: 22px;
border: 1px solid #CDD1DA;
border-radius: 50%;
background: #FFF;
}
.radio + label:after {
content: '';
position: absolute;
top: 1px;
left: 4px;
width: 16px;
height: 16px;
border-radius: 50%;
background: #9FD468;
box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
opacity: 0;
transition: .2s;
}
.radio:checked + label:after {
opacity: 1;
}
.radio:focus + label:before {
box-shadow: 0 0 0 3px rgba(255,255,0,.7);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment