Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created April 29, 2018 08:05
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 CodeMyUI/2ac006b5918c613b4348b210cb3ee826 to your computer and use it in GitHub Desktop.
Save CodeMyUI/2ac006b5918c613b4348b210cb3ee826 to your computer and use it in GitHub Desktop.
input #002 - Checkbox
.checkbox-container
input(type="checkbox" id="rememberMe")
label(for="rememberMe" class="checkbox")
label(for="rememberMe") Remember me?
.checkbox-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
input[type="checkbox"] {
display: none;
}
label {
cursor: pointer;
}
}
.checkbox-container .checkbox {
display: inline-block;
width: 15px;
height: 15px;
background: #d0d0d0;
&:after {
content: "";
position: absolute;
width: 0px;
height: 3px;
background: #3498db;
transform:translate(4px, 11px) rotate(-45deg);
transform-origin: left;
transition: all 150ms;
transition-delay: 0ms;
}
&:before {
content: "";
position: absolute;
width: 0px;
height: 3px;
background: #3498db;
transform:translate(1px, 6px) rotate(45deg);
transform-origin: left;
transition: all 150ms;
transition-delay: 150ms;
}
}
.checkbox-container input[type="checkbox"]:checked {
& ~ .checkbox {
&:before {
width: 7px;
transition-delay: 0ms;
}
&:after {
width: 13px;
transition-delay: 150ms;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment