From da0afdf4efd746b7dfc8562e64d348fb182df916 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Tue, 2 Jun 2020 11:31:03 +0800 Subject: [PATCH] fix: tabs inkbar border lost (#24643) * fix: tabs inkbar border lost * fix --- components/tabs/style/card.less | 21 ++++++++++++++------- components/tabs/style/index.less | 3 ++- components/tabs/style/position.less | 27 ++++++++++++++++++--------- components/tabs/style/rtl.less | 5 +++-- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/components/tabs/style/card.less b/components/tabs/style/card.less index 80820141e9..7cfc47e512 100644 --- a/components/tabs/style/card.less +++ b/components/tabs/style/card.less @@ -3,7 +3,8 @@ @import './index'; .@{tab-prefix-cls}-card { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { margin: 0; padding: @tabs-card-horizontal-padding; @@ -25,7 +26,8 @@ // ========================== Top & Bottom ========================== &.@{tab-prefix-cls}-top, &.@{tab-prefix-cls}-bottom { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab:not(:last-of-type) { margin-right: @tabs-card-gutter; } @@ -33,7 +35,8 @@ } &.@{tab-prefix-cls}-top { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { border-radius: @border-radius-base @border-radius-base 0 0; @@ -44,7 +47,8 @@ } } &.@{tab-prefix-cls}-bottom { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { border-radius: 0 0 @border-radius-base @border-radius-base; @@ -58,7 +62,8 @@ // ========================== Left & Right ========================== &.@{tab-prefix-cls}-left, &.@{tab-prefix-cls}-right { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab:not(:last-of-type) { margin-bottom: @tabs-card-gutter; } @@ -66,7 +71,8 @@ } &.@{tab-prefix-cls}-left { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { border-radius: @border-radius-base 0 0 @border-radius-base; @@ -77,7 +83,8 @@ } } &.@{tab-prefix-cls}-right { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { border-radius: 0 @border-radius-base @border-radius-base 0; diff --git a/components/tabs/style/index.less b/components/tabs/style/index.less index 9db2714900..2287f94a1c 100644 --- a/components/tabs/style/index.less +++ b/components/tabs/style/index.less @@ -15,7 +15,8 @@ overflow: hidden; // ========================== Navigation ========================== - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { position: relative; display: flex; flex: none; diff --git a/components/tabs/style/position.less b/components/tabs/style/position.less index a1f027057b..d05c7679e2 100644 --- a/components/tabs/style/position.less +++ b/components/tabs/style/position.less @@ -6,7 +6,8 @@ &-bottom { flex-direction: column; - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { margin: @tabs-bar-margin; &::before { @@ -54,7 +55,8 @@ } &-top { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { &::before { bottom: 0; } @@ -66,7 +68,8 @@ } &-bottom { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { order: 1; margin-top: @margin-md; margin-bottom: 0; @@ -80,7 +83,8 @@ } } - > .@{tab-prefix-cls}-content-holder { + > .@{tab-prefix-cls}-content-holder, + > div > .@{tab-prefix-cls}-content-holder { order: 0; } } @@ -88,7 +92,8 @@ // ========================== Left & Right ========================== &-left, &-right { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { flex-direction: column; min-width: 50px; @@ -148,13 +153,15 @@ } &-left { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-ink-bar { right: 0; } } - > .@{tab-prefix-cls}-content-holder { + > .@{tab-prefix-cls}-content-holder, + > div > .@{tab-prefix-cls}-content-holder { margin-left: -@border-width-base; border-left: @border-width-base @border-style-base @border-color-split; @@ -165,7 +172,8 @@ } &-right { - > .@{tab-prefix-cls}-nav { + > .@{tab-prefix-cls}-nav, + > div > .@{tab-prefix-cls}-nav { order: 1; .@{tab-prefix-cls}-ink-bar { @@ -173,7 +181,8 @@ } } - > .@{tab-prefix-cls}-content-holder { + > .@{tab-prefix-cls}-content-holder, + > div > .@{tab-prefix-cls}-content-holder { order: 0; margin-right: -@border-width-base; border-right: @border-width-base @border-style-base @border-color-split; diff --git a/components/tabs/style/rtl.less b/components/tabs/style/rtl.less index b1f37c315f..473a8e0be3 100644 --- a/components/tabs/style/rtl.less +++ b/components/tabs/style/rtl.less @@ -1,11 +1,12 @@ @import '../../style/themes/index'; @import '../../style/mixins/index'; -@import './index'; + +@tab-prefix-cls: ~'@{ant-prefix}-tabs'; .@{tab-prefix-cls}-rtl { direction: rtl; - > .@{tab-prefix-cls}-nav { + .@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-tab { margin: @tabs-horizontal-margin-rtl;