From 4320bc737b5af3b9d0c589c7736704786e4a3c7e Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Tue, 30 Oct 2018 14:51:53 +0800 Subject: [PATCH] Chore: fix switch style --- src/components/Switch/style.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Switch/style.scss b/src/components/Switch/style.scss index 84ce0e6..7f0be43 100644 --- a/src/components/Switch/style.scss +++ b/src/components/Switch/style.scss @@ -19,7 +19,7 @@ $width: 32px; background-color: $color-primary; &::after { - transform: translateX(-$switch-offset); + transform: translateX($width - $switch-radius + $switch-offset); } } @@ -47,13 +47,13 @@ $width: 32px; background-color: $color-white; box-shadow: 0 0 8px rgba($color-primary-dark, 0.4); transition: transform 0.3s ease; - transform: translateX($width - $switch-radius + $switch-offset); + transform: translateX(-$switch-offset); } } .switch-icon { position: absolute; - transform: translateX(13px) scale(0.4); + transform: translateX(-1px) scale(0.4); color: $color-white; line-height: $height; }