UNPKG

acud

Version:

acg react 组件库

263 lines (226 loc) • 6.54 kB
@import '../../style/themes/index'; @import '../../style/mixins/index'; @import './size'; @import './rtl'; @import './position'; @import './dropdown'; @import './card'; @component-background: #fff; @tab-prefix-cls: ~'@{acud-prefix}-tabs'; .@{tab-prefix-cls} { .reset-component(); display: flex; overflow: hidden; // ========================== Navigation ========================== >.@{tab-prefix-cls}-nav, >div>.@{tab-prefix-cls}-nav { position: relative; display: flex; flex: none; align-items: center; .@{tab-prefix-cls}-nav-wrap { position: relative; display: inline-block; display: flex; flex: auto; align-self: stretch; overflow: hidden; white-space: nowrap; transform: translate(0); // Fix chrome render bug // >>>>> Ping shadow &::before, &::after { position: absolute; z-index: 1; opacity: 0; // transition: opacity @animation-duration-slow; content: ''; pointer-events: none; } } .@{tab-prefix-cls}-nav-list { position: relative; display: flex; transition: transform @animation-duration-slow; } // >>>>>>>> Operations .@{tab-prefix-cls}-nav-operations { display: flex; align-self: stretch; &-hidden { position: absolute; visibility: hidden; pointer-events: none; } } .@{tab-prefix-cls}-nav-more { position: relative; padding: @tabs-card-horizontal-padding; padding-left: 0; padding-right: 0; background: transparent; border: 0; display: flex; justify-content: center; align-items: center; width: 6 * @P; border: @border-width-base @border-style-base @tabs-border-color-split; >span { display: flex; justify-content: center; align-items: center; } &.left { border-right: 0; } &.right { border-left: 0; } &::after { position: absolute; right: 0; bottom: 0; left: 0; height: 5px; transform: translateY(100%); content: ''; } } .@{tab-prefix-cls}-nav-add { width: 8 * @P; height: 8 * @P; // padding: 0 @padding-xs; background: @tabs-card-head-background; border: @border-width-base @border-style-base @tabs-border-color-split; border-radius: @tabs-border-radius-base @tabs-border-radius-base 0 0; outline: none; cursor: pointer; transition: all @animation-duration-slow @ease-in-out; margin-left: 2 * @P; .basic-tp-config(@tabs-head-tp); } } &-extra-content { flex: none; } &-centered { >.@{tab-prefix-cls}-nav, >div>.@{tab-prefix-cls}-nav { .@{tab-prefix-cls}-nav-wrap { &:not([class*='@{tab-prefix-cls}-nav-wrap-ping']) { justify-content: center; } } } } // ============================ InkBar ============================ &-ink-bar { position: absolute; background: @tabs-ink-bar-color; pointer-events: none; } // ============================= Tabs ============================= &-tab { position: relative; display: inline-flex; align-items: center; padding: @tabs-horizontal-padding; font-size: @tabs-title-font-size; background: transparent; border: 0; outline: none; cursor: pointer; user-select: none; .basic-tp-config(@tabs-head-tp); &-active { color: @tabs-active-color; } &-btn { outline: none; width: 100%; input { outline: none; border: 0; background: none; background: rgba(36,104,242,0.18); height: 4 * @P; line-height: 4 * @P; width: 100%; &:focus { outline: none; border: 0; } &:focus-visible { outline: none; border: 0; } } } &-with-remove { // padding-right: 3 * @P !important; } &-remove { flex: none; margin-right: -@margin-xss; margin-left: @margin-xs; span { height: 100%; display: flex; align-items: center; } background: transparent; border: none; outline: none; cursor: pointer; display: none; } &:hover { .@{tab-prefix-cls}-tab-remove { display: inline-block; color: inherit; } } &&-disabled { color: @disabled-color; cursor: not-allowed; } &&-disabled &-btn, &&-disabled &-remove { &:focus, &:active { color: @disabled-color; } } & &-remove .@{iconfont-css-prefix} { margin: 0; } .@{iconfont-css-prefix} { margin-right: 2 * @P; height: 100%; width: 4 * @P; line-height: 100%; font-size: 4 * @P; } } &-tab+&-tab { margin: @tabs-horizontal-margin; } // =========================== TabPanes =========================== &-content { &-holder { flex: auto; min-width: 0; min-height: 0; } display: flex; width: 100%; &-animated { transition: margin @animation-duration-slow; } } &-tabpane { flex: none; width: 100%; outline: none; } }