Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions src/tabs/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
export default {
'tiny-mobile-tabs-color': '#333',
'tiny-mobile-tabs-bgcolor': '#fff',
'tiny-mobile-tabs-font-size': '14px',
'tiny-mobile-tabs-header-height': '40px',
'tiny-mobile-tabs-border-color': '#ccc',
'tiny-mobile-tabs-active-color': '#f36f64',
'tiny-mobile-tabs-children-color': '#000',
'tiny-mobile-tabs-children-border-color': '#eee',
'tiny-mobile-tabs-new-tab-width': '44px',
'tiny-mobile-tabs-icon-font-size': '24px',
'tiny-mobile-tabs-icon-color': '#bbb'
}
"tiny-mobile-tabs-text-color": "#333",
"tiny-mobile-tabs-bg-color": "#fff",
"tiny-mobile-tabs-font-size": "14px",
"tiny-mobile-tabs-header-height": "48px",
"tiny-mobile-tabs-border-color": "#ccc",
"tiny-mobile-tabs-color-active": "#4a79fe",
"tiny-mobile-tabs-children-text-color": "#000",
"tiny-mobile-tabs-children-border-color": "#eee",
"tiny-mobile-tabs-new-tab-width": "44px",
"tiny-mobile-tabs-icon-font-size": "24px",
"tiny-mobile-tabs-icon-color": "#bbb",
"tiny-mobile-tabs-item-text-color": "#595959",
"tiny-mobile-tabs-item-text-color-active": "#191919",
"tiny-mobile-tabs-line-bg-color-active": "#4a79fe",
};
190 changes: 122 additions & 68 deletions src/tabs/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@
position: relative;

&__header {
overflow: hidden;
background: var(--ti-mobile-tabs-bgcolor, #fff);
background: var(--ti-mobile-tabs-bg-color, #fff);
position: relative;
.hairline('bottom', var(--ti-mobile-tabs-border-color, #ccc));

&.is-double-border {
.hairline('top', var(--ti-mobile-tabs-border-color, #ccc));
}
border-radius: 16px 16px 0px 0px;
box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.06) inset;
}

&__content {
overflow: hidden;
font-size: var(--ti-mobile-tabs-font-size, 14px);
color: var(--ti-mobile-tabs-color, #333);
background: var(--ti-mobile-tabs-bgcolor, #fff);
color: var(--ti-mobile-tabs-text-color, #333);
background: var(--ti-mobile-tabs-bg-color, #fff);
padding: 15px 24px;
}

Expand Down Expand Up @@ -75,13 +71,40 @@
overflow: hidden;
overflow-x: auto;
-webkit-overflow-scrolling: touch;

-webkit-tap-highlight-color: transparent;
&::-webkit-scrollbar {
display: none;
}
}
}

&__nav-wrap&__wrap-scrollable &__nav-scroll{
&:before{
position: absolute;
content: "";
top: 0;
bottom: 0;
left: 0;
width: 11%;
background: -webkit-gradient(linear, left top, right top, from(#fff), to(hsla(0, 0%, 100%, 0)));
background: linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0));
border-radius: 16px 0px 0px 0px;
z-index: 2;
}
&:after{
position: absolute;
content: "";
top: 0;
bottom: 0;
right: 0;
width: 11%;
background: -webkit-gradient(linear, left top, right top, from(hsla(0, 0%, 100%, 0)), to(#fff));
background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), #fff);
border-radius: 0px 16px 0px 0px;
z-index: 2;
}
}

&__nav {
white-space: nowrap;
position: relative;
Expand All @@ -94,12 +117,13 @@
flex: 1;
box-sizing: border-box;
text-align: center;
height: var(--ti-mobile-tabs-header-height, 40px);
line-height: var(--ti-mobile-tabs-header-height, 40px);
height: var(--ti-mobile-tabs-header-height, 48px);
line-height: var(--ti-mobile-tabs-header-height, 48px);
font-size: var(--ti-mobile-tabs-font-size, 14px);
color: var(--ti-mobile-tabs-color, #333);
color: var(--ti-mobile-tabs-item-text-color, #595959);
cursor: pointer;
transition: all 0.3s ease-in-out 0s;
font-weight: 400;
}

&__name {
Expand All @@ -108,7 +132,9 @@
}

&__item.is-active &__name {
color: var(--ti-mobile-tabs-active-color, #f36f64);
color: var(--ti-mobile-tabs-item-text-color-active, #191919);
font-weight: 500;
font-size: 15px;
position: relative;
}

Expand All @@ -117,54 +143,108 @@
bottom: 0;
left: 0;
z-index: 1;
width: 40px;
height: 2px;
background-color: var(--ti-mobile-tabs-active-color, #f36f64);
width: 20px;
height: 3px;
background-color: var(--ti-mobile-tabs-line-bg-color-active, #4a79fe);
border-radius: 3px;
transition-duration: 0.3s;
}

&__more-container {
&__expand-icon {
position: absolute;
top: 0;
right: 0;
z-index: 3;
}

&__more {
display: block;
&__expand {
display: inline-block;
font-size: 14px;
height: 40px;
line-height: 40px;
height: 48px;
line-height: 48px;
width: 48px;
text-align: center;
background: #fff;
z-index: 9999;
color: #f36f64;

svg {
fill: #595959;
}
}

&__more-list {
&__expand-content{
position: absolute;
top: 42px;
overflow-y: scroll;
z-index: 9999;
border: 1px solid #ccc;
border-radius: 5px;
right: 0px;
padding: 10px;
background: #fff;
background: #f5f5f5;
}

&__more-item {
height: 30px;
line-height: 30px;
min-width: 50px;
text-align: center;
&__expand-mask{
height: 22px;
}

&__expand-header{
height: 48px;
border-radius: 16px 16px 0px 0px;
box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.06) inset;
background: #fff;
color: #595959;
font-size: 14px;
color: #333;
display: flex;
align-items: center;
}

&__expand-header-title{
display: inline-block;
padding-left: 16px;
}

&__expand-list {
width: 100%;
max-height: 160px;
overflow-y: auto;
border-radius: 0px 0px 16px 16px;
box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.06) inset;
background: #fff;
padding: 16px;
margin-left: -10px;
margin-right: -10px;
}

&__expand-item {
margin-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
&:focus {
outline: 0;
}

}

&__expand-item&__expand-mode-columns{
width: 33.33%;
display: inline-block;
}

&__expand-item &__expand-item-title{
height: 36px;
line-height: 36px;
text-align: center;
font-size: 13px;
color: #191919;
font-weight: 400;
border-radius: 6px;
background: rgba(0, 0, 0, 0.04);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 0 5px;
&:hover {
color: #4a79fe;
}
}

&__expand-item-title.is-current{
background: rgba(74, 121, 254, 0.08);
color: #4a79fe;
font-weight: 500;
}

&__icon-close {
Expand All @@ -178,13 +258,13 @@
border-radius: 20px;
padding: 0px 12px;
font-size: 14px;
color: var(--ti-mobile-tabs-children-color, #000);
color: var(--ti-mobile-tabs-children-text-color, #000);
border: 1px solid var(--ti-mobile-tabs-children-border-color, #eee);
}

&__nav-wrap-children &__item.is-active &__name {
border: 1px solid var(--ti-mobile-tabs-active-color, #f36f64);
color: var(--ti-mobile-tabs-active-color, #f36f64);
border: 1px solid var(--ti-mobile-tabs-color-active, #4a79fe);
color: var(--ti-mobile-tabs-color-active, #4a79fe);

&:after {
border-bottom: 0;
Expand All @@ -200,30 +280,4 @@
}
}

&__more-popover {
position: fixed;
right: 0px;

ul {
display: block;
position: absolute;
width: 200px;
right: 0px;
min-width: 150px;
background: #fff;
top: 40px;
border-radius: 5px;
border: 1px solid #ccc;
}
}

&__more-item {
height: 30px;
line-height: 30px;
font-size: 14px;

&:hover {
color: #f36f64;
}
}
}
13 changes: 8 additions & 5 deletions src/tabs/vars.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
:root {
--ti-mobile-tabs-color: var(--ti-mobile-base-color-info-normal, #333);
--ti-mobile-tabs-bgcolor: var(--ti-mobile-base-color-light, #fff);
--ti-mobile-tabs-text-color: var(--ti-mobile-base-color-info-normal, #333);
--ti-mobile-tabs-bg-color: var(--ti-mobile-base-color-light, #fff);
--ti-mobile-tabs-font-size: 14px;
--ti-mobile-tabs-header-height: 40px;
--ti-mobile-tabs-header-height: 48px;
--ti-mobile-tabs-border-color: #ccc;
--ti-mobile-tabs-active-color: #f36f64;
--ti-mobile-tabs-children-color: var(--ti-mobile-base-color-dark, #000);
--ti-mobile-tabs-color-active: #4a79fe;
--ti-mobile-tabs-children-text-color: var(--ti-mobile-base-color-dark, #000);
--ti-mobile-tabs-children-border-color: #eee;
--ti-mobile-tabs-new-tab-width: 44px;
--ti-mobile-tabs-icon-font-size: 24px;
--ti-mobile-tabs-icon-color: #bbb;
--ti-mobile-tabs-item-text-color: #595959;
--ti-mobile-tabs-item-text-color-active: #191919;
--ti-mobile-tabs-line-bg-color-active: #4a79fe;
}