Skip to content

Commit a8957d9

Browse files
committed
fix: switch style
1 parent f2ed951 commit a8957d9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/renderer/components/basic/SwitchControl.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,25 @@ function change(event: Event) {
6565
.switch-content {
6666
position: absolute;
6767
top: 1px;
68+
right: calc(1em + 1px);
6869
left: 1px;
6970
z-index: 1;
7071
display: inline-block;
71-
width: 1em;
72+
// width: 1em;
7273
height: 1em;
7374
background: white;
7475
border-radius: 1em;
75-
transition: transform 0.2s;
76+
transition: left 0.2s, right 0.2s 40ms;
77+
.switch-checkbox:active + .switch-track > & {
78+
right: calc(0.75em + 1px);
79+
}
7680
.switch-checkbox:checked + .switch-track > & {
77-
transform: translateX(100%);
81+
right: 1px;
82+
left: calc(1em + 1px);
83+
transition: left 0.2s 40ms, right 0.2s;
84+
}
85+
.switch-checkbox:checked:active + .switch-track > & {
86+
left: calc(0.75em + 1px);
7887
}
7988
.switch-checkbox:focus-visible + .switch-track > & {
8089
background: rgb(255 255 255 / 75%);

0 commit comments

Comments
 (0)