瀏覽代碼

Merge branch 'main' of github.com:DouyinFE/semi-design

pointhalo 2 年之前
父節點
當前提交
d2c797b3d1
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      packages/semi-foundation/switch/switch.scss

+ 8 - 2
packages/semi-foundation/switch/switch.scss

@@ -25,9 +25,7 @@ $module: #{$prefix}-switch;
 
     &:active {
         border: $border-thickness-control $color-switch_default-bg-active solid;
-
         .#{$module}-knob {
-            // width: $knob-size + $knob-active-expand;
             width: $width-switch_knob_active;
         }
     }
@@ -69,6 +67,9 @@ $module: #{$prefix}-switch;
 
         &:active {
             background-color: $color-switch_disabled-bg-active;
+            .#{$module}-knob {
+                width: $width-switch_knob_default;
+            }
         }
 
         .#{$module}-knob {
@@ -85,6 +86,11 @@ $module: #{$prefix}-switch;
         &.#{$module}-checked {
             border-color: $color-switch_checked_disabled-border-default;
             background-color: $color-switch_checked_disabled-bg-default;
+            &:active {
+                .#{$module}-knob {
+                    transform: translateX($spacing-switch_checked-translateX);
+                }
+            }
             .#{$module}-knob {
                 @include shadow-0;
                 border: none;