@helpwave/hightide
Version:
helpwave's component and theming library
57 lines (43 loc) • 1.24 kB
CSS
@layer components {
[data-name="switch"] {
@apply flex-col-0 items-center justify-center;
@apply h-7 w-12 rounded-full border-2 p-1;
&:not([data-disabled]) {
@apply hover:cursor-pointer;
}
&[data-disabled] {
@apply border-on-disabled bg-disabled cursor-not-allowed;
}
&:not([data-disabled]) {
[data-invalid] {
@apply border-negative;
&:hover {
@apply border-negative-hover bg-negative/10;
}
}
&:not([data-invalid]) {
@apply bg-input-background border-border;
&:hover {
@apply border-primary-hover bg-primary/10;
}
&[data-active] {
@apply bg-primary border-primary;
&:hover {
@apply bg-primary-hover border-primary-hover;
}
}
}
}
}
[data-name="switch-track"] {
@apply w-full h-full rounded-full flex items-center relative;
}
[data-name="switch-thumb"] {
@apply bg-on-surface rounded-full transition-all duration-[var(--animation-duration-in,250ms)] h-3 w-3;
@apply absolute top-1/2 -translate-y-1/2 left-0.5;
&[data-active] {
@apply w-4 h-4;
left: calc(100% - 4 * var(--spacing));
}
}
}