From 4e20ed2b412ade4a563753e3d339621a3f84e566 Mon Sep 17 00:00:00 2001 From: zefeng Date: Sat, 4 Apr 2020 22:27:11 +0800 Subject: [PATCH] fix(rtl): fix radio rtl overrided by theme (#22926) --- components/radio/style/rtl.less | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/components/radio/style/rtl.less b/components/radio/style/rtl.less index 3806645d14..f443bc4d76 100644 --- a/components/radio/style/rtl.less +++ b/components/radio/style/rtl.less @@ -3,30 +3,31 @@ @radio-prefix-cls: ~'@{ant-prefix}-radio'; @radio-group-prefix-cls: ~'@{radio-prefix-cls}-group'; +@radio-prefix-cls-button-wrapper: ~'@{radio-prefix-cls}-button-wrapper'; .@{radio-group-prefix-cls} { - &-rtl { + &&-rtl { direction: rtl; } } // 一般状态 .@{radio-prefix-cls}-wrapper { - &-rtl { + &&-rtl { margin-right: 0; margin-left: 8px; } } -.@{radio-prefix-cls}-button-wrapper { - &-rtl { +.@{radio-prefix-cls-button-wrapper} { + &&-rtl { border-right-width: 0; border-left-width: @border-width-base; } &:not(:first-child) { &::before { - .@{radio-prefix-cls}-button-wrapper-rtl& { + .@{radio-prefix-cls-button-wrapper}.@{radio-prefix-cls-button-wrapper}-rtl& { right: -1px; left: 0; } @@ -34,24 +35,24 @@ } &:first-child { - .@{radio-prefix-cls}-button-wrapper-rtl& { + .@{radio-prefix-cls-button-wrapper}.@{radio-prefix-cls-button-wrapper}-rtl& { border-right: @border-width-base @border-style-base @border-color-base; border-radius: 0 @border-radius-base @border-radius-base 0; } - .@{radio-prefix-cls}-button-wrapper-checked:not([class*=~"' @{radio-prefix-cls}-button-wrapper-disabled'"])& { + .@{radio-prefix-cls-button-wrapper}-checked:not([class*=~"' @{radio-prefix-cls}-button-wrapper-disabled'"])& { border-right-color: @radio-button-hover-color; } } &:last-child { - .@{radio-prefix-cls}-button-wrapper-rtl& { + .@{radio-prefix-cls-button-wrapper}.@{radio-prefix-cls-button-wrapper}-rtl& { border-radius: @border-radius-base 0 0 @border-radius-base; } } &-disabled { &:first-child { - .@{radio-prefix-cls}-button-wrapper-rtl& { + .@{radio-prefix-cls-button-wrapper}.@{radio-prefix-cls-button-wrapper}-rtl& { border-right-color: @border-color-base; } }