input[type='checkbox'] {
    appearance: none;
    position: relative;
    display: inline-block;
    background: lightgrey;
    height: 1.15rem;
    width: 1.75rem;
    vertical-align: middle;
    border-radius: 2rem;
    box-shadow: 0px 1px 3px #0003 inset;
    transition: 0.25s linear background;
}

input[type='checkbox']::before {
    content: "";
    display: block;
    width: .75rem;
    height: .75rem;
    background: #fff;
    border-radius: 1.2rem;
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    box-shadow: 0px 1px 3px #0003;
    transition: 0.1s linear transform;
    transform: translateX(0rem);
}

input[type='checkbox']:checked {
    background: greenyellow;
}
input[type='checkbox']:checked::before {
    transform: translateX(0.6rem);
}

/*
<label>
    <input type='checkbox'>
    Click me!
</label>
*/