Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp
2.7 KB
Raw Blame
/* SPDX-License-Identifier: AGPL-3.0-or-later */

.container {
	display: flex;
	min-height: 2.75rem;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.25rem 0;
}

.container.compact {
	min-height: unset;
	gap: 0.75rem;
	padding: 0;
}

.labelContainer {
	display: flex;
	min-width: 0;
	flex: 1 1 0%;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	text-align: start;
}

.label {
	display: flex;
	min-width: 0;
	max-width: 100%;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--text-primary);
}

.label.disabled {
	cursor: not-allowed;
}

.labelContainer.clickable {
	cursor: pointer;
}

.description {
	padding-inline-end: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--text-primary-muted);
}

.switchRoot {
	--switch-highlight: rgba(255, 255, 255, 0.1);
	display: inline-flex;
	align-items: center;
	position: relative;
	height: 1.5rem;
	width: 2.75rem;
	border-radius: 624.9375rem;
	background-color: rgb(107 114 128);
	box-shadow:
		inset 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.15),
		0 0.0625rem 0 0 var(--switch-highlight);
	transition-property: color, background-color, border-color, box-shadow;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
}

.switchRoot:hover {
	--switch-highlight: rgba(255, 255, 255, 0.15);
}

.switchRoot.disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.switchRoot[data-state='checked'] {
	background-color: var(--brand-primary);
	box-shadow:
		inset 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.1),
		0 0.0625rem 0 0 rgba(255, 255, 255, 0.15);
}

.switchThumb {
	position: relative;
	display: flex;
	height: 1.25rem;
	width: 1.25rem;
	align-items: center;
	justify-content: center;
	border-radius: 624.9375rem;
	background-color: white;
	box-shadow:
		inset 0 -0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.08),
		0 0.0625rem 0 0 rgba(0, 0, 0, 0.15),
		0 0.125rem 0.25rem -0.0625rem rgba(0, 0, 0, 0.2);
	transition-property: transform, box-shadow;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateX(calc(0.125rem * var(--switch-travel-sign, 1)));
}

.switchRoot:active .switchThumb {
	box-shadow:
		inset 0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.1),
		0 0 0 0 rgba(0, 0, 0, 0.15),
		0 0.0625rem 0.125rem -0.0625rem rgba(0, 0, 0, 0.15);
}

.switchThumb[data-state='checked'] {
	background-color: var(--brand-primary-fill);
	transform: translateX(calc(1.375rem * var(--switch-travel-sign, 1)));
}

:global(html[dir='rtl']) .switchRoot {
	--switch-travel-sign: -1;
}

.iconChecked {
	color: var(--brand-primary);
}

.iconUnchecked {
	color: rgb(107 114 128);
}