From 6e2c156ba1571c9dbe8a948575ec99f49b67551d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=95=E9=87=8F?= Date: Thu, 10 Feb 2022 10:26:45 +0800 Subject: [PATCH] fix(Switch): set children text size to form-element-font-size, fix #3710 (#3711) --- src/switch/main.scss | 8 ++++++++ src/switch/scss/mixin.scss | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/switch/main.scss b/src/switch/main.scss index ebf7ec1e98..cc929a3087 100644 --- a/src/switch/main.scss +++ b/src/switch/main.scss @@ -39,6 +39,10 @@ &-medium { @include bounding($switch-size-m-width, $switch-size-m-trigger, #{$switch-border-width-container}, $switch-border-width-trigger, $switch-size-m-radius-container, $switch-size-m-radius-trigger); + > .#{$css-prefix}switch-children { + font-size: $form-element-medium-font-size; + } + &.#{$css-prefix}switch.#{$css-prefix}switch-on > .#{$css-prefix}switch-children { margin: 0 calc(#{$switch-size-m-trigger} + #{$switch-size-m-trigger-padding-r}) 0 $switch-size-m-trigger-padding-l; } @@ -58,6 +62,10 @@ &-small { @include bounding($switch-size-s-width, $switch-size-s-trigger, #{$switch-border-width-container}, $switch-border-width-trigger, $switch-size-s-radius-container, $switch-size-s-radius-trigger); + > .#{$css-prefix}switch-children { + font-size: $form-element-small-font-size; + } + &.#{$css-prefix}switch.#{$css-prefix}switch-on > .#{$css-prefix}switch-children { margin: 0 calc(#{$switch-size-s-trigger} + #{$switch-size-s-trigger-padding-r}) 0 $switch-size-s-trigger-padding-l; } diff --git a/src/switch/scss/mixin.scss b/src/switch/scss/mixin.scss index e52839b29a..cccb3d05a4 100755 --- a/src/switch/scss/mixin.scss +++ b/src/switch/scss/mixin.scss @@ -43,7 +43,6 @@ box-sizing: border-box; } > .#{$css-prefix}switch-children { - font-size: $font-size-body-1; height: $trigger-size; line-height: $trigger-size; }