@charset "UTF-8";

/**********
 * Switch *
 **********/

$switch-height: 24px;

switch {
	margin: 2px;
	font-weight: bold;
	font-size: smaller;
	border: 1px solid;
	border-radius: 12px;
	color: transparent;
	background-color: gtkalpha(
		gtk("@theme_button_foreground_normal"),
		0.05
	);
	border-color: gtkalpha(
		gtk("@theme_button_foreground_normal"),
		0.222
	);
	text-shadow: none;

	&:disabled {
		background-color: gtkalpha(
			gtk("@theme_button_foreground_normal"),
			0.03
		);
	}

	&:checked {
		background: gtkalpha(
			gtk("@theme_button_decoration_hover"),
			0.333
		);
		border-color: gtk("@theme_button_decoration_hover");

		&:disabled {
			background: gtkalpha(
				gtk("@theme_button_decoration_hover"),
				0.222
			);
			border-color: gtkalpha(
				gtk("@theme_button_decoration_hover"),
				0.777
			);
		}
	}

	&:dir(ltr) {
		&:checked slider {
			margin-left: 1px;
		}
		&:not(:checked) slider {
			margin-right: 1px;
		}
	}

	slider {
		min-width: $switch-height;
		min-height: $switch-height;
		margin: -($switch-height / 6);
		border: 1px solid;
		border-radius: $switch-height / 2;

		box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.125);
		border-color: gtk("@borders");
		background: gtk("@theme_button_background_normal");
	}

	&:hover slider {
		border-color: gtk("@theme_button_decoration_hover");
	}

	&:focus slider {
		border-color: gtk("@theme_button_decoration_focus");
	}

	&:disabled slider {
		box-shadow: none;
		color: gtk("@theme_button_foreground_insensitive");
		border-color: gtk("@insensitive_borders");
		background: gtk("@theme_button_background_insensitive");

		&:active,
		&:checked {
			color: gtk(
				"@theme_button_foreground_active_insensitive"
			);
		}
	}
}
