Skip to content

Instantly share code, notes, and snippets.

@EvanLovely
Created August 3, 2013 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvanLovely/6144452 to your computer and use it in GitHub Desktop.
Save EvanLovely/6144452 to your computer and use it in GitHub Desktop.
Fancy CSS3 Checkboxes (for Drupal Markup)
.form-type-checkbox {
padding-left: 18px;
padding-right: 2px;
position: relative;
>input {
position: absolute;
left: 0;
top: 4px;
top: 0\9;
/* Custom WebKit Checkboxes */
-webkit-appearance: none;
width: 13px;
height: 13px;
width: auto\9;
height: auto\9;
border: 0;
background: white;
background: transparent\9;
border: solid 1px rgba(63, 151, 206, 0.6);
-webkit-box-shadow:inset 0 0 4px rgba(0,0,0,0.19);
-webkit-transition: all .3s linear;
&:after {
-webkit-transition: all .3s linear;
opacity: 0;
content: '';
display: block;
position: absolute;
top: -6px;
left: -5px;
width: 20px;
height: 16px;
background-position: 0 0;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAtklEQVQ4y2P4//8/A7Ux1Q0cxoaC ADIbCUgCMTvVXAoE5kA8CYidyXYpGrAH4iVAHIXiCwoMDQTimUBcBsRMlBrKCsTpUANzkC0j11Bu IK6EGlgKsoAkQ4FgChD7AzELVI8YEDdDDawDYk6YQaQY6gg1oAqILYC4D8oHGcyLbBAphoJAKtQg GO4EYiHk2CLHUJAXm6AG9gCxNHoSIMdQEJCFGqiALaGSayjMxQwUGzq0S6nhZygA2ojsbh6J67kA AAAASUVORK5CYII=");
}
&:active {
background: rgba(255, 255, 255, 0.1);
outline:none;
&:after {opacity:.3;}
}
&:focus {
outline: none;
}
&:checked {
&:after {opacity: 1;}
&:active:after {opacity: .3;}
}
}
>label {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment