naive-ui/styles/Tabs.scss

238 lines
6.6 KiB
SCSS
Raw Normal View History

2019-12-13 17:32:38 +08:00
@import './mixins/mixins.scss';
2020-02-11 14:44:29 +08:00
2019-12-13 17:32:38 +08:00
@mixin tabs-size-mixin ($size) {
@include m($size + '-size') {
@include m(line-type) {
@include b(tabs-label) {
@include e(label) {
font-size: map-get($--n-tabs-tab-font-size, $size);
}
2019-12-13 17:32:38 +08:00
}
}
}
}
@include themes-mixin {
@include b(tabs) {
@include once {
@include tabs-size-mixin('small');
@include tabs-size-mixin('medium');
@include tabs-size-mixin('large');
@include tabs-size-mixin('huge');
width: 100%;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
@include m(flex) {
@include b(tabs-nav) {
@include b(tabs-nav-scroll) {
width: 100%;
@include b(tabs-label-wrapper) {
width: 100%;
@include b(tabs-label) {
margin-right: 0;
}
}
}
}
}
}
@include b(tabs-nav) {
@include once {
line-height: 1.75;
2019-12-13 17:32:38 +08:00
display: flex;
background-clip: padding-box;
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
@include b(tabs-nav-scroll) {
overflow: hidden;
}
}
@include b(tabs-nav-scroll-button) {
@include once {
font-size: 20px;
height: 20px;
line-height: 20px;
align-self: center;
cursor: pointer;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
@include m(left) {
margin-right: 8px;
}
@include m(right) {
margin-left: 8px;
}
}
2020-02-20 21:42:38 +08:00
@include b(icon) {
fill: map-get($--tabs-tab-scroll-button-color, 'default');
}
2019-12-13 17:32:38 +08:00
@include m(disabled) {
@include once {
cursor: not-allowed;
}
2020-02-20 21:42:38 +08:00
@include b(icon) {
fill: map-get($--tabs-tab-scroll-button-color, 'disabled');
}
2019-12-13 17:32:38 +08:00
}
}
}
@include b(tabs-label-wrapper) {
@include once {
display: inline-block;
2020-02-27 23:02:58 +08:00
font-weight: $--n-strong-weight;
2019-12-13 17:32:38 +08:00
white-space: nowrap;
position: relative;
}
@include b(tabs-label-bar) {
@include once {
position: absolute;
bottom: 2px;
height: 2px;
border-radius: 1px;
2019-12-31 18:25:14 +08:00
transition: left .2s $--n-ease-in-out-cubic-bezier, max-width .2s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
}
background-color: $--tabs-tab-bar-background-color;
@include m(transition-disabled) {
transition: none;
}
2019-12-13 17:32:38 +08:00
}
@include b(tabs-label) {
@include once {
cursor: pointer;
white-space: nowrap;
flex-wrap: nowrap;
display: inline-flex;
align-items: center;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
@include m(disabled) {
cursor: not-allowed;
}
}
@include e(close) {
@include once {
margin-left: 8px;
font-size: 16px;
line-height: 16px;
height: 16px;
cursor: pointer;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
}
2020-02-20 21:42:38 +08:00
@include b(icon) {
fill: map-get($--tabs-tab-close-button-color, 'default');
}
2019-12-13 17:32:38 +08:00
}
@include e(label) {
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
}
color: map-get($--tabs-tab-text-color, 'default');
}
}
}
@include b(tab-panel) {
@include once {
width: 100%;
margin-top: 8px;
transition: color .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-13 17:32:38 +08:00
}
color: $--tabs-panel-text-color;
}
@include m(line-type) {
@include once {
@include b(tabs-nav) {
@include b(tabs-nav-scroll-button) {
padding-bottom: 4px;
}
}
}
@include b(tabs-label) {
@include once {
box-sizing: border-box;
padding-bottom: 2px;
2019-12-13 17:32:38 +08:00
vertical-align: bottom;
@include e(label) {
font-size: 14px;
}
&:not(:last-child) {
margin-right: 36px;
}
}
&:hover {
@include e(label) {
color: map-get($--tabs-tab-text-color, 'hover');
}
}
@include m(active) {
@include e(label) {
color: map-get($--tabs-tab-text-color, 'active');
}
}
@include m(disabled) {
@include e(label) {
color: map-get($--tabs-tab-text-color, 'disabled');
}
}
}
}
@include m(card-type) {
@include b(tabs-nav) {
@include once {
box-sizing: border-box;
padding-top: 4px;
padding-bottom: 4px;
@include b(tabs-nav-scroll-button) {
@include m(left) {
margin-left: 2px;
margin-right: 2px;
}
@include m(right) {
margin-left: 2px;
margin-right: 2px;
}
}
@include b(tabs-label-bar) {
bottom: 0;
border-radius: 0;
}
}
border-top: 1px solid $--tabs-nav-border-color;
border-bottom: 1px solid $--tabs-nav-border-color;
}
@include b(tabs-label) {
@include once {
margin-right: 4px;
box-sizing: border-box;
height: 34px;
line-height: 34px;
padding: 0 16px;
position: relative;
vertical-align: bottom;
2020-02-28 22:57:10 +08:00
border-radius: $--n-tabs-border-radius;
2019-12-13 17:32:38 +08:00
border: 1px solid transparent;
}
@include e(label) {
@include once {
font-size: 14px;
}
color: map-get($--tabs-card-tab-text-color, 'default')
}
&:hover {
background-color: $--tabs-card-tab-background-color;
}
@include m(active) {
background-color: $--tabs-card-tab-background-color;
border: 1px solid $--tabs-card-tab-border-color;
@include e(label) {
@include once {
font-size: 14px;
}
color: map-get($--tabs-card-tab-text-color, 'active')
}
}
@include m(disabled) {
@include e(label) {
color: map-get($--tabs-tab-text-color, 'disabled');
}
}
}
}
}
}