@mixin switch() {
  switch {
    outline-offset: -4px;
    margin: 4px;
    color: gtkalpha($fg_color, 0.9);
    border: 1px solid gtkmix($bg_color, $dark_shadow, 0.4);
    border-radius: $button_radius + 1;
    background-color: gtkmix($bg_color, $dark_shadow, 0.4);

    &:checked {
      color: gtkalpha($selected_fg_color, 0.9);
      border-color: $selected_bg_color;
      background-color: $selected_bg_color;

      &:backdrop {
        color: gtkalpha($unfocused_selected_fg_color, 0.9);
        border-color: $unfocused_borders;
        background-color: $unfocused_borders;
      }
    }

    &:disabled {
      color: gtkalpha($fg_color, 0.6);
      border-color: $disabled_bg_color;
      background-color: $disabled_bg_color;

      &:backdrop {
        color: gtkalpha($fg_color, 0.6);
        border-color: $unfocused_disabled_bg_color;
        background-color: $unfocused_disabled_bg_color;
      }
    }

    &:backdrop {
      color: gtkalpha($unfocused_fg_color, 0.9);
      border-color: $unfocused_borders;
      background-color: $unfocused_borders;
    }

    slider {
      min-width: 30px;
      min-height: 20px;
      margin: 0;
      border-radius: $button_radius;
      color: $fg_color;
      border: 1px solid $borders;
      background-color: $bg_color;
      background-image: linear-gradient(to bottom, gtkshade($bg_color, 1.2), gtkshade($bg_color, 0.8));
      box-shadow: inset 0 1px gtkalpha($light_shadow, 0.1), inset 0 -1px gtkalpha($dark_shadow, 0.1);
    }

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

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

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