@mixin switch() {
  switch {
    font-size: 0;
    outline-offset: -4px;
    margin: 4px;
    border: 1px solid $borders;
    border-radius: $roundness + 1;
    background-color: $bg_color;
    
    &:checked {
      background-color: $selected_bg_color;
      
      &:backdrop {
        background-color: $unfocused_selected_bg_color;
      }
    }

    &:disabled {
      border-color: $disabled_fg_color;
      background-color: $disabled_bg_color;

      &:backdrop {
        border-color: $unfocused_disabled_fg_color;
        background-color: $unfocused_disabled_bg_color;
      }
    }

    &:backdrop {
      border-color: $unfocused_borders;
      background-color: $unfocused_bg_color;
    }

    slider {
      min-width: 26px;
      min-height: 20px;
      margin: -1px;
      border: 1px solid $borders;
      border-radius: $roundness;
      color: $fg_color;
      background-color: $base_color;
    }

    &:disabled {
      slider {
        background-color: $disabled_bg_color;
      }

      &:backdrop slider {
        background-color: $unfocused_disabled_bg_color;
      }
    }

    &:backdrop slider {
      background-color: $unfocused_base_color;
    }
  }
}
