@chatui/core
Version:
The React library for Chatbot UI
99 lines (86 loc) • 1.7 kB
text/less
@tabs-nav-margin: 4px;
@scrollable-width: 18px;
.Tabs {
--tab-font-size: 15px;
--tab-active-color: var(--color-text-1);
--tab-line-bottom: 5px;
&[data-color='primary'] {
--tab-active-color: var(--brand-1);
}
&[data-size='lg'] {
--tab-font-size: 18px;
--tab-line-bottom: 3px;
}
}
.Tabs-nav {
position: relative;
display: flex;
margin: @tabs-nav-margin 0;
&::-webkit-scrollbar {
display: none;
}
}
.Tabs--scrollable {
.Tabs-nav {
position: relative;
overflow: hidden;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
// 隐藏滚动条
margin-bottom: -(@scrollable-width - @tabs-nav-margin);
padding-bottom: @scrollable-width;
}
.Tabs-navItem {
flex: none;
&:first-child {
padding-left: 6px;
}
&:last-child {
padding-right: 6px;
}
}
}
.Tabs-navItem {
flex: 1;
text-align: center;
}
.Tabs-navLink {
padding: 9px;
border: 0;
border-radius: var(--radius-md);
background: transparent;
color: var(--color-text-2);
font-size: var(--tab-font-size);
line-height: 18px;
transition: color 0.3s;
&:focus:not(:focus-visible) {
outline: 0;
}
&:hover {
cursor: pointer;
color: var(--color-text-1);
}
&.active {
position: relative;
z-index: 1;
color: var(--tab-active-color);
font-weight: bold;
&:after {
content: '';
position: absolute;
bottom: var(--tab-line-bottom);
left: 50%;
transform: translateX(-50%);
width: 12px;
height: 2px;
background: currentColor;
border-radius: var(--radius-sm);
}
}
}
.Tabs-pane {
display: none;
&.active {
display: block;
}
}