Skip to content

Commit

Permalink
Update Switch component with refinements
Browse files Browse the repository at this point in the history
By request of UX team
  • Loading branch information
linearcombination committed Jan 3, 2024
1 parent 3ad2d85 commit 56aefa6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions frontend/src/components/Switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,26 @@
.switch {
@apply relative inline-block align-middle cursor-pointer select-none bg-transparent;
}
.track {
@apply w-11 h-7 bg-white border-2 border-gray-600 rounded-full shadow-inner;
@apply w-11 h-7 bg-white border border-[#343434] rounded-full shadow-inner;
}
.thumb {
@apply transition-all duration-300 ease-in-out absolute top-1 left-1 w-5 h-5 bg-gray-600 border-2 border-gray-600 rounded-full;
@apply transition-all duration-300 ease-in-out absolute top-1 left-1 w-5 h-5 bg-[#343434] rounded-full;
}
input[type='checkbox']:checked ~ .thumb {
@apply transform translate-x-4;
}
input[type='checkbox']:checked ~ .track {
@apply transform transition-colors;
background: linear-gradient(180deg, #1876fd 0%, #015ad9 100%),
linear-gradient(0deg, #33445c, #33445c);
linear-gradient(0deg, #343434, #343434);
}
input[type='checkbox']:disabled ~ .track {
@apply bg-gray-500;
}
input[type='checkbox']:disabled ~ .thumb {
@apply bg-gray-100 border-gray-500;
}
input[type='checkbox']:focus + .track,
input[type='checkbox']:active + .track {
@apply outline outline-2;
Expand Down

0 comments on commit 56aefa6

Please sign in to comment.