web/Toggle: jiggle physics & don't stretch on long press

This commit is contained in:
wukko 2025-03-05 17:30:15 +06:00
parent 6b09bd4688
commit fd5f7c36b2
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -21,7 +21,7 @@
border-radius: 5px;
border-radius: 100px;
background: var(--toggle-bg);
transition: background 0.2s;
transition: background 0.25s;
}
.toggle:dir(rtl) {
@ -34,7 +34,7 @@
background: var(--white);
border-radius: 100px;
transform: translateX(0%);
transition: transform 0.2s, width 0.2s;
transition: transform 0.25s cubic-bezier(0.53, 0.05, 0.02, 1.2);
}
.toggle.enabled {
@ -44,8 +44,4 @@
.toggle.enabled .toggle-switcher {
transform: translateX(var(--enabled-pos));
}
:global(.toggle-container:active .toggle:not(.enabled) .toggle-switcher) {
width: calc(var(--base-size) * 1.3);
}
</style>