JSFiddle - React, Tailwind, and code Playground

by Scott Kaye

HTML

<input type="checkbox">
<input type="checkbox" checked>

SCSS

input[type='checkbox'] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #888;
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  color: #fff;
  outline: none;
  vertical-align: middle;
  margin: 0 5px 0 0 !important; // Required for alignment with label

  &:focus {
    box-shadow: 0 0 0 2px #fff;
  }

  &:checked::before {
   opacity: 1;
  }

  &::before {
    content: "\2713";
    opacity: 0;
    display: block;
    font-size: 1.2em;
    line-height: 1.2em;
    text-align: center;
  }
}