From 710455fed5082ca60eaa93318fca50aaa858884f Mon Sep 17 00:00:00 2001 From: TC-twwang <741682830@qq.com> Date: Mon, 13 Mar 2023 19:19:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(tabs):=20tabs=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tabs/index.js | 27 ++++--- src/tabs/index.less | 190 ++++++++++++++++++++++++++++---------------- src/tabs/vars.less | 13 +-- 3 files changed, 145 insertions(+), 85 deletions(-) diff --git a/src/tabs/index.js b/src/tabs/index.js index 05ee9ed..111dac2 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -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", +}; diff --git a/src/tabs/index.less b/src/tabs/index.less index 95004cb..07b4bf9 100644 --- a/src/tabs/index.less +++ b/src/tabs/index.less @@ -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; } @@ -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; @@ -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 { @@ -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; } @@ -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 { @@ -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; @@ -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; - } - } } diff --git a/src/tabs/vars.less b/src/tabs/vars.less index 73ee296..3f84db5 100644 --- a/src/tabs/vars.less +++ b/src/tabs/vars.less @@ -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; } From 29e26b38314f79518e2104229b51d3f89f3a88cc Mon Sep 17 00:00:00 2001 From: TC-twwang <741682830@qq.com> Date: Wed, 15 Mar 2023 19:47:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(pull-refresh):=20pull-refresh=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E4=B8=8A=E6=8B=89=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pull-refresh/index.js | 6 +++--- src/pull-refresh/index.less | 14 +++++++++++--- src/pull-refresh/vars.less | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pull-refresh/index.js b/src/pull-refresh/index.js index 0332cd0..14786f9 100644 --- a/src/pull-refresh/index.js +++ b/src/pull-refresh/index.js @@ -1,4 +1,4 @@ export default { - 'tiny-mobile-pull-refresh-head-color': '#969799', - 'tiny-mobile-pull-refresh-head-font-size': '14px' -} + "tiny-mobile-pull-refresh-head-text-color": "#969799", + "tiny-mobile-pull-refresh-head-font-size": "14px", +}; diff --git a/src/pull-refresh/index.less b/src/pull-refresh/index.less index 0f55f04..d82af64 100644 --- a/src/pull-refresh/index.less +++ b/src/pull-refresh/index.less @@ -16,26 +16,34 @@ @pull-refresh-prefix-cls: ~'@{css-prefix}mobile-pull-refresh'; .@{pull-refresh-prefix-cls} { + height: 100%; user-select: none; - &__track { position: relative; height: 100%; transition-property: transform; } - &__head { + &__tips { position: absolute; left: 0; width: 100%; overflow: hidden; - color: var(--ti-mobile-pull-refresh-head-color, #969799); + color: var(--ti-mobile-pull-refresh-head-text-color, #969799); font-size: var(--ti-mobile-pull-refresh-head-font-size, 14px); line-height: 50px; text-align: center; + } + + &__head { transform: translateY(-100%); } + &__content { + overflow-y: auto; + height: 100%; + } + &__loading { position: relative; display: inline-block; diff --git a/src/pull-refresh/vars.less b/src/pull-refresh/vars.less index 3261851..4c4fc08 100644 --- a/src/pull-refresh/vars.less +++ b/src/pull-refresh/vars.less @@ -1,4 +1,4 @@ :root { - --ti-mobile-pull-refresh-head-color: #969799; + --ti-mobile-pull-refresh-head-text-color: #969799; --ti-mobile-pull-refresh-head-font-size: 14px; }