From d16001695921866814f994d7f0a69eb381f768fb Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Mon, 13 Apr 2020 13:53:42 +0800 Subject: [PATCH] style: fix steps rtl (#23183) --- components/steps/style/progress-dot.less | 48 ---------------- components/steps/style/rtl.less | 72 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 48 deletions(-) diff --git a/components/steps/style/progress-dot.less b/components/steps/style/progress-dot.less index 69ad523190..96077f1e2b 100644 --- a/components/steps/style/progress-dot.less +++ b/components/steps/style/progress-dot.less @@ -10,28 +10,14 @@ margin: 0 0 0 @steps-desciption-max-width / 2; padding: 0; - .@{steps-prefix-cls}-rtl& { - margin: 0 @steps-desciption-max-width / 2 0 0; - } - &::after { width: ~'calc(100% - 20px)'; height: 3px; margin-left: 12px; - - .@{steps-prefix-cls}-rtl& { - margin-right: 12px; - margin-left: 0; - } } } &:first-child .@{steps-prefix-cls}-icon-dot { left: 2px; - - .@{steps-prefix-cls}-rtl& { - right: 2px; - left: auto; - } } &-icon { width: @steps-dot-size; @@ -42,11 +28,6 @@ background: transparent; border: 0; - .@{steps-prefix-cls}-rtl& { - margin-right: 67px; - margin-left: 0; - } - .@{steps-prefix-cls}-icon-dot { position: relative; float: left; @@ -54,10 +35,6 @@ height: 100%; border-radius: 100px; transition: all 0.3s; - - .@{steps-prefix-cls}-rtl& { - float: right; - } /* expand hover area */ &::after { position: absolute; @@ -67,11 +44,6 @@ height: 32px; background: fade(@black, 0.1%); content: ''; - - .@{steps-prefix-cls}-rtl& { - right: -26px; - left: auto; - } } } } @@ -94,11 +66,6 @@ margin-top: 8px; margin-left: 0; background: none; - - .@{steps-prefix-cls}-rtl& { - margin-right: 0; - margin-left: 16px; - } } // https://github.com/ant-design/ant-design/issues/18354 .@{steps-prefix-cls}-item > .@{steps-prefix-cls}-item-container > .@{steps-prefix-cls}-item-tail { @@ -106,26 +73,11 @@ left: -9px; margin: 0; padding: 22px 0 4px; - - .@{steps-prefix-cls}-rtl& { - right: -9px; - left: auto; - } } .@{steps-prefix-cls}-item:first-child .@{steps-prefix-cls}-icon-dot { left: 0; - - .@{steps-prefix-cls}-rtl& { - right: 0; - left: auto; - } } .@{steps-prefix-cls}-item-process .@{steps-prefix-cls}-icon-dot { left: -2px; - - .@{steps-prefix-cls}-rtl& { - right: -2px; - left: auto; - } } } diff --git a/components/steps/style/rtl.less b/components/steps/style/rtl.less index 56c9642478..f99319f814 100644 --- a/components/steps/style/rtl.less +++ b/components/steps/style/rtl.less @@ -174,3 +174,75 @@ } } } + +// progress-dot +.@{steps-prefix-cls}-dot, +.@{steps-prefix-cls}-dot.@{steps-prefix-cls}-small { + .@{steps-prefix-cls}-item { + &-tail { + .@{steps-prefix-cls}-rtl& { + margin: 0 @steps-desciption-max-width / 2 0 0; + } + + &::after { + .@{steps-prefix-cls}-rtl& { + margin-right: 12px; + margin-left: 0; + } + } + } + &:first-child .@{steps-prefix-cls}-icon-dot { + .@{steps-prefix-cls}-rtl& { + right: 2px; + left: auto; + } + } + &-icon { + .@{steps-prefix-cls}-rtl& { + margin-right: 67px; + margin-left: 0; + } + + .@{steps-prefix-cls}-icon-dot { + .@{steps-prefix-cls}-rtl& { + float: right; + } + /* expand hover area */ + &::after { + .@{steps-prefix-cls}-rtl& { + right: -26px; + left: auto; + } + } + } + } + } +} + +.@{steps-prefix-cls}-vertical.@{steps-prefix-cls}-dot { + .@{steps-prefix-cls}-item-icon { + .@{steps-prefix-cls}-rtl& { + margin-right: 0; + margin-left: 16px; + } + } + // https://github.com/ant-design/ant-design/issues/18354 + .@{steps-prefix-cls}-item > .@{steps-prefix-cls}-item-container > .@{steps-prefix-cls}-item-tail { + .@{steps-prefix-cls}-rtl& { + right: -9px; + left: auto; + } + } + .@{steps-prefix-cls}-item:first-child .@{steps-prefix-cls}-icon-dot { + .@{steps-prefix-cls}-rtl& { + right: 0; + left: auto; + } + } + .@{steps-prefix-cls}-item-process .@{steps-prefix-cls}-icon-dot { + .@{steps-prefix-cls}-rtl& { + right: -2px; + left: auto; + } + } +}