From e30bd6552aad66eecca5312878a863731755ed16 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 23 Nov 2018 21:06:40 +0800 Subject: [PATCH] [improvement] Tab: update active style (#940) --- packages/common/style/var.less | 2 +- packages/tabs/index.less | 7 ++++--- packages/tabs/index.wxml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/common/style/var.less b/packages/common/style/var.less index 10946b65..6d2896a1 100644 --- a/packages/common/style/var.less +++ b/packages/common/style/var.less @@ -9,7 +9,7 @@ @green: #4b0; @gray: #c9c9c9; @gray-light: #e5e5e5; -@gray-darker: #666; +@gray-darker: #7d7e80; @gray-dark: #999; /* default colors */ diff --git a/packages/tabs/index.less b/packages/tabs/index.less index 7c6299c8..7bbdf077 100644 --- a/packages/tabs/index.less +++ b/packages/tabs/index.less @@ -71,7 +71,7 @@ height: 2px; position: absolute; background-color: @red; - border-radius: 2px 0 2px 0; + border-radius: 2px; } &--line { @@ -98,7 +98,7 @@ padding: 0 5px; font-size: 14px; position: relative; - color: @text-color; + color: @gray-darker; line-height: @van-tabs-line-height; text-align: center; box-sizing: border-box; @@ -110,7 +110,8 @@ } &--active { - color: @red; + font-weight: 500; + color: @text-color; } &--disabled { diff --git a/packages/tabs/index.wxml b/packages/tabs/index.wxml index aa00475a..299a0537 100644 --- a/packages/tabs/index.wxml +++ b/packages/tabs/index.wxml @@ -14,7 +14,7 @@ wx:key="index" data-index="{{ index }}" class="van-ellipsis van-tab {{ index === active ? 'van-tab--active' : '' }} {{ item.disabled ? 'van-tab--disabled' : '' }}" - style="{{ color && (index === active) !== (type === 'card') && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }}" + style="{{ color && index !== active && type === 'card' && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }}" bind:tap="onTap" > {{ item.title }}