oak-general-business/app/miniprogram_npm/tdesign/tab-bar/tab-bar-item.less

151 lines
2.8 KiB
Plaintext

@import '../common/index.less';
@item: ~'@{prefix}-tab-bar-item';
@tab-bar-height: 48px;
@tab-bar-bg-color: @bg-color-block;
@tab-bar-border-color: @border-level-1-color;
@tab-bar-hover-bg-color: rgba(0, 0, 0, 0.05);
@tab-bar-active-color: @primary-color;
@tab-bar-bg-color: @bg-color-block;
page {
--t-tab-bar-bg-color: @tab-bar-bg-color;
--t-tab-bar-hover-color: @tab-bar-hover-bg-color;
}
:host {
flex: 1;
}
.@{item} {
height: @tab-bar-height;
box-sizing: border-box;
user-select: none;
position: relative;
background-color: var(--t-tab-bar-bg-color);
&--active {
background-color: var(--t-tab-bar-hover-color);
}
&.@{prefix}-is-split:before {
.hairline-left(@color: @tab-bar-border-color);
top: 8px;
bottom: 8px;
}
&__content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&.@{prefix}-is-checked {
color: @tab-bar-active-color;
.@{item}__icon-menu {
background-color: @tab-bar-active-color;
}
}
}
.@{prefix}-badge-class {
transform: translate(50%, -10%) !important; // stylelint-disable-line
}
&__text {
display: flex;
align-items: center;
&.t-size-s {
font-size: 10px;
line-height: 18px;
}
}
&__icon {
height: 24px;
}
&__icon-menu {
width: 8px;
height: 1px;
background-color: #666;
position: relative;
margin-right: 4px;
&::before,
&::after {
display: block;
content: '';
position: absolute;
left: 0;
background-color: inherit;
width: inherit;
height: inherit;
}
&::before {
top: -4px;
}
&::after {
bottom: -4px;
}
}
&__spread {
position: absolute;
top: 0;
left: 7%;
width: 86%;
background-color: @tab-bar-bg-color;
transform: translate3d(0, calc(-100% - 16px), 0);
z-index: 1;
&::before {
display: block;
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 0;
border: 8px solid transparent;
border-top: 8px solid @tab-bar-bg-color;
transform: translate3d(-50%, 16px, 0);
}
&-item {
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
&--active {
background-color: @tab-bar-hover-bg-color;
}
& + .@{item}__spread-item {
position: relative;
&:before {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
top: 0;
border-top: 1px solid #e6e6e6;
transform: scaleY(0.5);
border-top-width: 1px;
border-top-style: solid;
border-top-color: @tab-bar-border-color;
width: 80%;
}
}
}
}
}