fun-tab
Version:
A mobile touch-swappable tabs component for Vue3
73 lines (69 loc) • 1.18 kB
CSS
.fun-tab-bar-wrap {
display: flex;
flex-wrap: nowrap;
align-items: stretch;
min-height: 50px;
background: #fff;
}
.fun-tab-bar .fun-tab-item {
flex: 1 1;
font-size: 12px;
}
.fun-tab-bar .fun-tab-item__badge {
top: 2px;
right: 0;
}
.fun-tab-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.fun-tab-item__wrap {
position: relative;
}
.fun-tab-item__badge {
position: absolute;
top: 4px;
right: -10px;
padding: 0 4px;
min-width: 8px;
height: 14px;
font-size: 9px;
line-height: 14px;
color: #fff;
background: #ff411c;
white-space: nowrap;
border-radius: 100px;
transform: translate(50%, -50%);
text-align: center;
}
.fun-tabs {
overflow: hidden;
position: relative;
width: 100%;
border-bottom: 1px solid #eee;
background: #fff;
}
.fun-tabs__tab-list {
position: relative;
display: flex;
flex-wrap: nowrap;
min-width: 100%;
width: min-content;
}
.fun-tabs__active-line {
position: absolute;
bottom: 3px;
left: 0;
width: 30px;
height: 3px;
border-radius: 4px;
}
.fun-tabs .fun-tab-item {
padding: 10px 12px;
flex: 1 1 auto;
font-size: 14px;
text-align: center;
white-space: nowrap;
}