Skip to content

Instantly share code, notes, and snippets.

@AnteaterKit
Created December 24, 2020 21:06
Show Gist options
  • Save AnteaterKit/82580b321c6503f029cda62b444393d2 to your computer and use it in GitHub Desktop.
Save AnteaterKit/82580b321c6503f029cda62b444393d2 to your computer and use it in GitHub Desktop.
.checkbox {
position: relative;
width: 16px;
height: 16px;
cursor: pointer;
}
.checkbox input {
margin: 0px;
background: none;
}
.checkbox-inner {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
width: inherit;
height: inherit;
border: 2px solid grey;
background-color: #fff;
border-radius: 2px;
}
.checkbox-inner:hover {
border: 2px solid yellowgreen;
}
.checkbox-checked .checkbox-inner {
background-color: yellowgreen;
border: 2px solid yellowgreen;
}
.checkbox-checked .checkbox-inner::after {
position: absolute;
display: table;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
transform: rotate(45deg) scale(1) translate(-50%,-50%);
opacity: 1;
top: 50%;
left: 21%;
display: table;
width: 5px;
height: 9px;
content: '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment