JSFiddle - React, Tailwind, and code Playground

by Sean Xu

HTML

<div class="checkbox">
  <div class="checkbox-checked"></div>
</div>

CSS

body {
    width: 480px;
    margin: 0 auto;
    background-color: #231f20;
}

.checkbox {
    position: relative;
    margin: 3em auto;
    width: 50px;
    height: 50px;
    border: 15px solid #ed1c24;
    border-radius: 50%;
    cursor: pointer;
}

.checkbox:hover .checkbox-checked {
    border-color: green;
}

.checkbox:after {
    content: "";
    position: absolute;
    left: 28px;
    width: 60px;
    height: 55px;
    margin-top: -1px;
    background-color: #231f20;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.checkbox .checkbox-checked {
    position: absolute;
    width: 25px;
    height: 50px;
    margin: -9px 0 0 20px;
    border: 12px solid #fff;
    border-top: 0;
    border-left: 0;
     -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    box-sizing: border-box;
    z-index: 1;
}