Skip to content

Instantly share code, notes, and snippets.

@Webklex
Created April 11, 2014 14:58
Show Gist options
  • Save Webklex/10475663 to your computer and use it in GitHub Desktop.
Save Webklex/10475663 to your computer and use it in GitHub Desktop.
Radio/Checkboxes HACK
/*******************************************************************************
* Radio/Checkboxes HACK
*******************************************************************************/
input[type=checkbox]:not(old),
input[type=radio ]:not(old){
width : 2em;
margin : 0;
padding : 0;
font-size : 1em;
opacity : 0;
}
input[type=checkbox]:not(old) + label,
input[type=radio ]:not(old) + label{
display : inline-block;
margin-left : -2em;
line-height : 1.5em;
}
input[type=checkbox]:not(old) + label > span,
input[type=radio ]:not(old) + label > span{
display : inline-block;
width : 0.875em;
height : 0.875em;
margin : 0.25em 0.5em 0.25em 0.25em;
border : 2px solid #333;
border-radius : 0.875em;
background : rgb(224,224,224);
vertical-align : bottom;
}
input[type=checkbox]:not(old):checked + label > span:before{
content : '';
display : block;
width : 0.875em;
height : 0.875em;
border : 0.0625em solid #333;
border-radius : 0.875em;
background : #333;
margin: -0.125em 0 0 -0.125em;
}
input[type=radio]:not(old):checked + label > span > span{
display : block;
width : 0.875em;
height : 0.875em;
margin : 0.125em;
border : 0.0625em solid #333;
border-radius : 0.875em;
background : #333;
margin: -0.125em 0 0 -0.125em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment