diff --git a/packages/index.less b/packages/index.less index a708ad20c..870a3c056 100644 --- a/packages/index.less +++ b/packages/index.less @@ -23,7 +23,6 @@ @import './steps/index'; @import './step/index'; @import './tag/index'; -@import './tab/index'; @import './tabs/index'; @import './tabbar/index'; @import './tabbar-item/index'; diff --git a/packages/style/var.less b/packages/style/var.less index f56d6340c..33e9a4789 100644 --- a/packages/style/var.less +++ b/packages/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/tab/index.less b/packages/tab/index.less deleted file mode 100644 index b07570b81..000000000 --- a/packages/tab/index.less +++ /dev/null @@ -1,27 +0,0 @@ -@import '../style/var'; - -.van-tab { - flex: 1; - cursor: pointer; - padding: 0 5px; - font-size: 14px; - position: relative; - color: @text-color; - line-height: @tabs-line-height; - text-align: center; - box-sizing: border-box; - background-color: @white; - min-width: 0; /* hack for flex ellipsis */ - - span { - display: block; - } - - &--active { - color: @red; - } - - &--disabled { - color: @gray; - } -} diff --git a/packages/tabs/index.less b/packages/tabs/index.less index 627ffcef2..cb8230251 100644 --- a/packages/tabs/index.less +++ b/packages/tabs/index.less @@ -1,5 +1,32 @@ @import '../style/var'; +.van-tab { + flex: 1; + cursor: pointer; + padding: 0 5px; + font-size: 14px; + position: relative; + color: @gray-darker; + line-height: @tabs-line-height; + text-align: center; + box-sizing: border-box; + background-color: @white; + min-width: 0; /* hack for flex ellipsis */ + + span { + display: block; + } + + &--active { + font-weight: 500; + color: @text-color; + } + + &--disabled { + color: @gray; + } +} + .van-tabs { position: relative; @@ -83,7 +110,7 @@ bottom: 15px; height: 2px; position: absolute; - border-radius: 2px 0; + border-radius: 2px; background-color: @red; } diff --git a/packages/tabs/index.vue b/packages/tabs/index.vue index 0e8b26da5..c0f4179a6 100644 --- a/packages/tabs/index.vue +++ b/packages/tabs/index.vue @@ -375,7 +375,7 @@ export default create({ const isCard = this.type === 'card'; if (color) { - if (!item.disabled && isCard !== active) { + if (!item.disabled && isCard && !active) { style.color = color; } if (!item.disabled && isCard && active) {