[improvement] Tabbar: add less vars (#3124)

This commit is contained in:
neverland 2019-04-10 15:58:05 +08:00 committed by GitHub
parent f08de77c73
commit e5fc82e96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 10 deletions

View File

@ -210,6 +210,18 @@
@tabs-line-height: 44px; @tabs-line-height: 44px;
@tabs-card-height: 30px; @tabs-card-height: 30px;
// Tabbar
@tabbar-height: 50px;
@tabbar-background-color: @white;
// TabbarItem
@tabbar-item-font-size: 12px;
@tabbar-item-text-color: @gray-darker;
@tabbar-item-active-color: @blue;
@tabbar-item-line-height: 1;
@tabbar-item-icon-size: 18px;
@tabbar-item-margin-bottom: 5px;
// Tag // Tag
@tag-padding: .2em .5em; @tag-padding: .2em .5em;
@tag-font-size: 10px; @tag-font-size: 10px;

View File

@ -3,17 +3,17 @@
.van-tabbar-item { .van-tabbar-item {
flex: 1; flex: 1;
display: flex; display: flex;
line-height: 1; color: @tabbar-item-text-color;
font-size: 12px; font-size: @tabbar-item-font-size;
color: @gray-darker; line-height: @tabbar-item-line-height;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
&__icon { &__icon {
font-size: 18px;
position: relative; position: relative;
margin-bottom: 5px; font-size: @tabbar-item-icon-size;
margin-bottom: @tabbar-item-margin-bottom;
.van-icon { .van-icon {
display: block; display: block;
@ -34,13 +34,13 @@
} }
img { img {
height: 18px;
display: block; display: block;
height: @tabbar-item-icon-size;
} }
} }
&--active { &--active {
color: @blue; color: @tabbar-item-active-color;
} }
.van-info { .van-info {

View File

@ -1,10 +1,10 @@
@import '../style/var'; @import '../style/var';
.van-tabbar { .van-tabbar {
width: 100%;
height: 50px;
display: flex; display: flex;
background-color: @white; width: 100%;
height: @tabbar-height;
background-color: @tabbar-background-color;
&--fixed { &--fixed {
left: 0; left: 0;