diff --git a/components/tabs/style/index.less b/components/tabs/style/index.less index e2c8e5f45d..4cb5299bd3 100644 --- a/components/tabs/style/index.less +++ b/components/tabs/style/index.less @@ -4,6 +4,18 @@ @tab-prefix-cls: ~'@{ant-prefix}-tabs'; +// Hidden content +.tabs-hidden-content() { + height: 0; + padding: 0 !important; + overflow: hidden; + opacity: 0; + pointer-events: none; + input { + visibility: hidden; + } +} + .@{tab-prefix-cls} { .reset-component; position: relative; @@ -231,13 +243,7 @@ } > .@{tab-prefix-cls}-tabpane-inactive { - height: 0; - padding: 0 !important; - opacity: 0; - pointer-events: none; - input { - visibility: hidden; - } + .tabs-hidden-content(); } &.@{tab-prefix-cls}-content-animated { @@ -397,7 +403,7 @@ transform: none !important; } > .@{tab-prefix-cls}-tabpane-inactive { - display: none; + .tabs-hidden-content(); } }