@mixin switch() {
  switch {
    font-size: 0;
    color: transparent;
    outline-offset: -4px;
    margin: 4px;
    border: none;
    border-radius: $roundness;
    background-color: $borders;
    background-image: linear-gradient(to bottom, gtkshade($borders, 0.9), $borders);

    &:checked {
      background-color: gtkshade($selected_bg_color, 0.7);
      background-image: linear-gradient(to bottom, gtkshade($selected_bg_color, 0.7), gtkshade($selected_bg_color, 0.85));

      &:backdrop {
        background-color: $unfocused_selected_bg_color;
        background-image: linear-gradient(to bottom, gtkshade($unfocused_selected_bg_color, 0.7), gtkshade($unfocused_selected_bg_color, 0.85));
      }
    }

    &:disabled {
      background-color: $disabled_bg_color;
      background-image: linear-gradient(to bottom, gtkshade($disabled_bg_color, 0.9), $disabled_bg_color);

      &:backdrop {
        background-color: $unfocused_disabled_bg_color;
        background-image: linear-gradient(to bottom, gtkshade($unfocused_disabled_bg_color, 0.9), $unfocused_disabled_bg_color);
      }
    }

    &:backdrop {
      background-color: $unfocused_borders;
      background-image: linear-gradient(to bottom, gtkshade($unfocused_borders, 0.9), $unfocused_borders);
    }

    slider {
      min-width: 20px;
      min-height: 16px;
      margin: 0;
      border: 1px solid gtkshade($borders, 0.8);
      border-radius: $roundness;
      color: $fg_color;
      background-color: $base_color;
      background-image: linear-gradient(to bottom, gtkshade($bg_color, 1.1), gtkshade($bg_color, 0.985) 50%, gtkshade($bg_color, 0.95) 51%, gtkshade($bg_color, 0.94));
    }

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

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

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