<div>
<div class="box">
<input id="one" type="checkbox">
<span class="check"></span>
<label for="one">Check me.</label>
</div>
<div class="box">
<input id="two" type="checkbox">
<span class="check"></span>
<label for="two">Hey! Check me too.</label>
</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Quicksand:400,700&display=swap');
body {
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
font-family: 'Quicksand', sans-serif;
line-height: 1.5;
font-weight: bold;
}
.box {
width: 300px;
margin: 25px 0;
display: flex;
align-items: center;
user-select: none;
label {
font-size: 26px;
color: #4D4D4D;
position: absolute;
z-index: 10;
padding-left: 50px;
cursor: pointer;
}
input {
opacity: 0;
visibility: hidden;
position: absolute;
&:checked {
~ .check {
border-color: #00EA90;
box-shadow: 0px 0px 0px 15px #00EA90 inset;
&::after {
opacity: 1;
transform: scale(1);
}
}
}
}
.check {
width: 30px;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
position: relative;
border-radius: 100px;
background-color: #FFF;
border: 2px solid #00EA90;
box-shadow: 0px 0px 0px 0px #00EA90 inset;
transition: all 0.15s cubic-bezier(0, 1.05, 0.72, 1.07);
&::after {
content: '';
width: 100%;
height: 100%;
opacity: 0;
z-index: 4;
position: absolute;
transform: scale(0);
background-size: 50%;
background-image: url('https://s6.picofile.com/d/8392306668/bacc888c-bed7-41a9-bf24-f6ff0718f471/checkmark.svg');
background-repeat: no-repeat;
background-position: center;
transition-delay: 0.2s !important;
transition: all 0.25s cubic-bezier(0, 1.05, 0.72, 1.07);
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.