* {
    box-sizing: border-box;
  }

  body {
    height: 100vh;
    margin: 0;
    transition: background 0.2s linear;
  }

  body.dark {
    background-color: #292c35;
  }

  .checkbox {
    opacity: 0;
    position: absolute;
  }
  
  .toggle > .label {
    width: 4vw;
    height: 2vw;
    background-color:#111;
    display: flex;
    border-radius:50px;
    align-items: center;
    justify-content: space-between;
    padding: .5em;
    position: relative;
    transform: scale(1.5);
  }
  
  .ball {
    width: 1.6vw;
    height: 1.6vw;
    background-color: white;
    position: absolute;
    top: 0.2vw;
    left: 0.2vw;
    border-radius: 50%;
    transition: transform 0.2s linear;
  }
  
  /*  target the elemenent after the label*/
  .checkbox:checked + .label .ball{
    transform: translateX(2vw);
  }
  
  .fa-moon {
    color: rgb(255, 255, 255);
  }
  
  .fa-sun {
    color: rgb(250, 250, 45);
  }