mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-23 18:00:33 +08:00
[improvement] update color variables (#842)
This commit is contained in:
parent
40306007a5
commit
f7f82ff571
@ -3,5 +3,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
color: #38f;
|
color: #1989fa;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
.icon {
|
.icon {
|
||||||
color: #38f;
|
color: #1989fa;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ Page({
|
|||||||
duration: 1000,
|
duration: 1000,
|
||||||
text: '通知内容',
|
text: '通知内容',
|
||||||
selector: '#custom-selector',
|
selector: '#custom-selector',
|
||||||
backgroundColor: '#38f'
|
backgroundColor: '#1989fa'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<van-tag type="primary" custom-class="van-tag">标签</van-tag>
|
<van-tag type="primary" custom-class="van-tag">标签</van-tag>
|
||||||
<view slot="tip">
|
<view slot="tip">
|
||||||
您的收货地址不支持同城送
|
您的收货地址不支持同城送
|
||||||
<text class="van-edit-address" bindtap="onClickLink">修改地址</text>
|
<text class="edit-address" bindtap="onClickLink">修改地址</text>
|
||||||
</view>
|
</view>
|
||||||
</van-submit-bar>
|
</van-submit-bar>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
position: relative !important;
|
position: relative !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-edit-address {
|
.edit-address {
|
||||||
color: #38f;
|
color: #1989fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-tag {
|
.van-tag {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<demo-block title="基础用法" padding>
|
<demo-block title="基础用法" padding>
|
||||||
<van-tag class="demo-margin-right">标签</van-tag>
|
<van-tag class="demo-margin-right">标签</van-tag>
|
||||||
<van-tag class="demo-margin-right" type="danger">标签</van-tag>
|
<van-tag class="demo-margin-right" type="danger">标签</van-tag>
|
||||||
<van-tag class="demo-margin-right" type="success">标签</van-tag>
|
<van-tag class="demo-margin-right" type="primary">标签</van-tag>
|
||||||
<van-tag type="primary">标签</van-tag>
|
<van-tag type="success">标签</van-tag>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
<demo-block title="空心样式" padding>
|
<demo-block title="空心样式" padding>
|
||||||
|
@ -5,5 +5,5 @@
|
|||||||
height: 100px;
|
height: 100px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
margin: -50px 0 0 -50px;
|
margin: -50px 0 0 -50px;
|
||||||
background-color: #38f;
|
background-color: #1989fa;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view wx:if="{{ loading }}" class="van-picker__loading">
|
<view wx:if="{{ loading }}" class="van-picker__loading">
|
||||||
<van-loading color="#38f"/>
|
<van-loading color="#1989fa"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<picker-view
|
<picker-view
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
padding: 5px 15px 5px 115px;
|
|
||||||
background: #fafafa;
|
|
||||||
color: @text-color;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
color: @text-color;
|
||||||
|
padding: 5px 15px 5px 115px;
|
||||||
|
background: @background-color-light;
|
||||||
|
|
||||||
&--center {
|
&--center {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
width: @van-checkbox-size;
|
width: @van-checkbox-size;
|
||||||
height: @van-checkbox-size;
|
height: @van-checkbox-size;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid @gray-light;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -28,9 +28,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&--checked {
|
&--checked {
|
||||||
|
color: @white;
|
||||||
border-color: @green;
|
border-color: @green;
|
||||||
background-color: @green;
|
background-color: @green;
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
|
3
packages/common/color.ts
Normal file
3
packages/common/color.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export const RED = '#f44';
|
||||||
|
export const BLUE = '#1989fa';
|
||||||
|
export const GREEN = '#4b0';
|
@ -2,9 +2,11 @@
|
|||||||
@black: #000;
|
@black: #000;
|
||||||
@white: #fff;
|
@white: #fff;
|
||||||
@red: #f44;
|
@red: #f44;
|
||||||
@blue: #38f;
|
@blue: #1989fa;
|
||||||
@orange: #ff976a;
|
@orange: #ff976a;
|
||||||
@green: #06bf04;
|
@orange-dark: #ed6a0c;
|
||||||
|
@orange-light: #fffbe8;
|
||||||
|
@green: #4b0;
|
||||||
@gray: #c9c9c9;
|
@gray: #c9c9c9;
|
||||||
@gray-light: #e5e5e5;
|
@gray-light: #e5e5e5;
|
||||||
@gray-darker: #666;
|
@gray-darker: #666;
|
||||||
@ -15,14 +17,15 @@
|
|||||||
@border-color: #eee;
|
@border-color: #eee;
|
||||||
@active-color: #e8e8e8;
|
@active-color: #e8e8e8;
|
||||||
@background-color: #f8f8f8;
|
@background-color: #f8f8f8;
|
||||||
|
@background-color-light: #fafafa;
|
||||||
|
|
||||||
/* button */
|
/* button */
|
||||||
@button-default-color: @text-color;
|
@button-default-color: @text-color;
|
||||||
@button-default-background-color: @white;
|
@button-default-background-color: @white;
|
||||||
@button-default-border-color: @border-color;
|
@button-default-border-color: @border-color;
|
||||||
@button-primary-color: @white;
|
@button-primary-color: @white;
|
||||||
@button-primary-background-color: #4b0;
|
@button-primary-background-color: @green;
|
||||||
@button-primary-border-color: #4b0;
|
@button-primary-border-color: @green;
|
||||||
@button-danger-color: @white;
|
@button-danger-color: @white;
|
||||||
@button-danger-background-color: @red;
|
@button-danger-background-color: @red;
|
||||||
@button-danger-border-color: @red;
|
@button-danger-border-color: @red;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
text-rendering: auto;
|
text-rendering: auto;
|
||||||
|
|
||||||
&__info {
|
&__info {
|
||||||
color: #fff;
|
color: @white;
|
||||||
left: 100%;
|
left: 100%;
|
||||||
top: -.5em;
|
top: -.5em;
|
||||||
font-size: .6em;
|
font-size: .6em;
|
||||||
|
@ -31,7 +31,7 @@ Notify({
|
|||||||
text: '通知内容',
|
text: '通知内容',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
selector: '#custom-selector',
|
selector: '#custom-selector',
|
||||||
backgroundColor: '#38f'
|
backgroundColor: '#1989fa'
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ Notify({
|
|||||||
| duration | 持续时间 | `Number` | `3000` |
|
| duration | 持续时间 | `Number` | `3000` |
|
||||||
| selector | 自定义选择器 | `String` | `van-notify` |
|
| selector | 自定义选择器 | `String` | `van-notify` |
|
||||||
| color | 字体颜色 | `String` | `#fff` | |
|
| color | 字体颜色 | `String` | `#fff` | |
|
||||||
| backgroundColor | 背景色 | `String` | `#e64340` |
|
| backgroundColor | 背景色 | `String` | `#f44` |
|
||||||
|
|
||||||
### 更新日志
|
### 更新日志
|
||||||
|
|
||||||
|
@ -10,5 +10,4 @@
|
|||||||
line-height: 2.3;
|
line-height: 2.3;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #E64340;
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { RED } from '../common/color';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -9,7 +10,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
backgroundColor: {
|
backgroundColor: {
|
||||||
type: String,
|
type: String,
|
||||||
value: '#e64340'
|
value: RED
|
||||||
},
|
},
|
||||||
duration: {
|
duration: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
| inactive | 是否置灰 | `Boolean` | `false` |
|
| inactive | 是否置灰 | `Boolean` | `false` |
|
||||||
| percentage | 进度百分比 | `Number` | `false` |
|
| percentage | 进度百分比 | `Number` | `false` |
|
||||||
| show-pivot | 是否显示进度文字 | `Boolean` | `true` |
|
| show-pivot | 是否显示进度文字 | `Boolean` | `true` |
|
||||||
| color | 进度条颜色 | `String` | `#38f` |
|
| color | 进度条颜色 | `String` | `#1989fa` |
|
||||||
| text-color | 进度条文字颜色 | `String` | `#fff` |
|
| text-color | 进度条文字颜色 | `String` | `#fff` |
|
||||||
| pivot-text | 文字显示 | `String` | 百分比文字 |
|
| pivot-text | 文字显示 | `String` | 百分比文字 |
|
||||||
| pivot-color | 文字背景色 | `String` | 与进度条颜色一致 |
|
| pivot-color | 文字背景色 | `String` | 与进度条颜色一致 |
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { BLUE } from '../common/color';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -12,7 +13,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
value: '#38f'
|
value: BLUE
|
||||||
},
|
},
|
||||||
textColor: {
|
textColor: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: #6c6c6c;
|
background-color: @gray-darker;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
|
@ -63,7 +63,7 @@ Page({
|
|||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
| active | 当前步骤 | `Number` | 0 |
|
| active | 当前步骤 | `Number` | 0 |
|
||||||
| direction | 显示方向,可选值为 `horizontal` `vertical` | `String` | `horizontal` |
|
| direction | 显示方向,可选值为 `horizontal` `vertical` | `String` | `horizontal` |
|
||||||
| active-color | 激活状态颜色 | `String` | `#06bf04` |
|
| active-color | 激活状态颜色 | `String` | `#4b0` |
|
||||||
|
|
||||||
### 外部样式类
|
### 外部样式类
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
&__circle {
|
&__circle {
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
background-color: #999;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
background-color: @gray-dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--horizontal {
|
&--horizontal {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { GREEN } from '../common/color';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -11,7 +12,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
activeColor: {
|
activeColor: {
|
||||||
type: String,
|
type: String,
|
||||||
value: '#06bf04'
|
value: GREEN
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&--on {
|
&--on {
|
||||||
background-color: #44db5e;
|
background-color: @blue;
|
||||||
|
|
||||||
.van-switch__node {
|
.van-switch__node {
|
||||||
transform: translateX(.6em);
|
transform: translateX(.6em);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-tabbar-item {
|
.van-tabbar-item {
|
||||||
color: #666;
|
color: @gray-darker;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
@ -23,7 +23,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
&__info {
|
&__info {
|
||||||
color: #fff;
|
color: @white;
|
||||||
left: 100%;
|
left: 100%;
|
||||||
top: -.5em;
|
top: -.5em;
|
||||||
font-size: .6em;
|
font-size: .6em;
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
```html
|
```html
|
||||||
<van-tag>标签</van-tag>
|
<van-tag>标签</van-tag>
|
||||||
<van-tag type="danger">标签</van-tag>
|
<van-tag type="danger">标签</van-tag>
|
||||||
<van-tag type="success">标签</van-tag>
|
|
||||||
<van-tag type="primary">标签</van-tag>
|
<van-tag type="primary">标签</van-tag>
|
||||||
|
<van-tag type="success">标签</van-tag>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 空心样式
|
#### 空心样式
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { RED, BLUE, GREEN } from '../common/color';
|
||||||
|
|
||||||
const DEFAULT_COLOR = '#999';
|
const DEFAULT_COLOR = '#999';
|
||||||
const COLOR_MAP = {
|
const COLOR_MAP = {
|
||||||
danger: '#f44',
|
danger: RED,
|
||||||
primary: '#38f',
|
primary: BLUE,
|
||||||
success: '#06bf04'
|
success: GREEN
|
||||||
};
|
};
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__nitem {
|
&__nitem {
|
||||||
line-height: 44px;
|
line-height: 44px;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
|
|
||||||
&:active,
|
&:active,
|
||||||
&--active {
|
&--active {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user