diff --git a/packages/badge-group/index.less b/packages/badge-group/index.less index 7fc1fc0b4..545f9304b 100644 --- a/packages/badge-group/index.less +++ b/packages/badge-group/index.less @@ -1,5 +1,5 @@ @import '../style/var'; .badge-group { - width: 85px; + width: @badge-group-width; } diff --git a/packages/badge/index.less b/packages/badge/index.less index 795494c6c..0269e487c 100644 --- a/packages/badge/index.less +++ b/packages/badge/index.less @@ -3,14 +3,14 @@ .van-badge { display: block; overflow: hidden; - font-size: 14px; - line-height: 1.4; user-select: none; - color: @gray-darker; word-break: break-all; box-sizing: border-box; - padding: 20px 12px 20px 9px; - background-color: @background-color; + color: @badge-text-color; + padding: @badge-padding; + font-size: @badge-font-size; + line-height: @badge-line-height; + background-color: @badge-background-color; border-left: 3px solid transparent; &__text { @@ -18,7 +18,7 @@ } &:active { - background-color: @active-color; + background-color: @badge-active-color; } &:not(:last-child)::after { @@ -26,9 +26,9 @@ } &--select { - font-weight: 500; - color: @text-color; - border-color: @red; + color: @badge-selected-text-color; + font-weight: @badge-selected-font-weight; + border-color: @badge-selected-border-color; &::after { border-right-width: 1px; @@ -36,7 +36,7 @@ &, &:active { - background-color: @white; + background-color: @badge-selected-background-color; } } diff --git a/packages/style/var.less b/packages/style/var.less index 3306e35d0..dbb788f7c 100644 --- a/packages/style/var.less +++ b/packages/style/var.less @@ -32,6 +32,21 @@ @action-sheet-close-icon-size: 18px; @action-sheet-close-icon-color: @gray-dark; +// Badge +@badge-font-size: 14px; +@badge-line-height: 1.4; +@badge-text-color: @gray-darker; +@badge-padding: 20px 12px 20px 9px; +@badge-active-color: @active-color; +@badge-background-color: @background-color; +@badge-selected-font-weight: 500; +@badge-selected-text-color: @text-color; +@badge-selected-border-color: @red; +@badge-selected-background-color: @white; + +// BadgeGroup +@badge-group-width: 85px; + // Button @button-mini-height: 22px; @button-mini-min-width: 50px;