Skip to content

Instantly share code, notes, and snippets.

@mauriciopasquier
Last active December 24, 2015 09:59
Show Gist options
  • Save mauriciopasquier/6780975 to your computer and use it in GitHub Desktop.
Save mauriciopasquier/6780975 to your computer and use it in GitHub Desktop.
Bootstrap style checkbox with pure css
input[type="checkbox"].bootstrapear {
display: none;
& + label {
display: inline;
position: relative;
@include border-radius(5px);
padding: 4px 6px;
margin-left: 0;
min-height: 30px;
height: 30px;
border: 1px solid $gris-claro;
color: $gray;
&:after {
content: "No...";
}
}
&:checked + label {
&:after {
content: "Sí!";
font-weight: bold;
}
}
}
# there must be a label adjacent to the checkbox
= f.check_box :publico, class: 'bootstrapear'
= f.label :publico, ' '.html_safe, class: 'span12'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment