mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +08:00
[Doc] update neutral color variables (#2130)
This commit is contained in:
parent
ec159b5e47
commit
f69c66b439
@ -20,12 +20,12 @@ There are some basic variables below, all available variables could be found in
|
|||||||
@green: #4b0;
|
@green: #4b0;
|
||||||
@gray: #c9c9c9;
|
@gray: #c9c9c9;
|
||||||
@gray-light: #e5e5e5;
|
@gray-light: #e5e5e5;
|
||||||
@gray-darker: #666;
|
@gray-darker: #7d7e80;
|
||||||
@gray-dark: #999;
|
@gray-dark: #969799;
|
||||||
|
|
||||||
// default colors
|
// default colors
|
||||||
@text-color: #333;
|
@text-color: #323233;
|
||||||
@border-color: #eee;
|
@border-color: #ebedf0;
|
||||||
@active-color: #e8e8e8;
|
@active-color: #e8e8e8;
|
||||||
@background-color: #f8f8f8;
|
@background-color: #f8f8f8;
|
||||||
@background-color-light: #fafafa;
|
@background-color-light: #fafafa;
|
||||||
|
@ -24,12 +24,12 @@ Vant 使用了 [Less](http://lesscss.org/) 对样式进行预处理,并内置
|
|||||||
@green: #4b0;
|
@green: #4b0;
|
||||||
@gray: #c9c9c9;
|
@gray: #c9c9c9;
|
||||||
@gray-light: #e5e5e5;
|
@gray-light: #e5e5e5;
|
||||||
@gray-darker: #666;
|
@gray-darker: #7d7e80;
|
||||||
@gray-dark: #999;
|
@gray-dark: #969799;
|
||||||
|
|
||||||
// default colors
|
// default colors
|
||||||
@text-color: #333;
|
@text-color: #323233;
|
||||||
@border-color: #eee;
|
@border-color: #ebedf0;
|
||||||
@active-color: #e8e8e8;
|
@active-color: #e8e8e8;
|
||||||
@background-color: #f8f8f8;
|
@background-color: #f8f8f8;
|
||||||
@background-color-light: #fafafa;
|
@background-color-light: #fafafa;
|
||||||
|
@ -43,9 +43,11 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../packages/style/var';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: #333;
|
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
color: @text-color;
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
font-family: 'PingFang SC', Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, Arial, sans-serif;
|
font-family: 'PingFang SC', Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
@ -128,7 +128,7 @@ export default {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: #fff;
|
color: @white;
|
||||||
background-color: @blue;
|
background-color: @blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,12 +46,14 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-badge {
|
.demo-badge {
|
||||||
.van-badge-group {
|
.van-badge-group {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin: 0 15px;
|
margin: 0 15px;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
fill="#fff"
|
fill="#fff"
|
||||||
:rate="rate"
|
:rate="rate"
|
||||||
size="120px"
|
size="120px"
|
||||||
layer-color="#eee"
|
layer-color="#ebedf0"
|
||||||
:speed="100"
|
:speed="100"
|
||||||
:stroke-width="60"
|
:stroke-width="60"
|
||||||
:clockwise="false"
|
:clockwise="false"
|
||||||
|
@ -43,7 +43,7 @@ export default {
|
|||||||
color="#13ce66"
|
color="#13ce66"
|
||||||
fill="#fff"
|
fill="#fff"
|
||||||
size="120px"
|
size="120px"
|
||||||
layer-color="#eee"
|
layer-color="#ebedf0"
|
||||||
:text="text"
|
:text="text"
|
||||||
:rate="rate"
|
:rate="rate"
|
||||||
:speed="100"
|
:speed="100"
|
||||||
|
@ -12,7 +12,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div class="van-circle" style="width:120px;height:120px;">
|
<div class="van-circle" style="width:120px;height:120px;">
|
||||||
<svg viewBox="0 0 1060 1060">
|
<svg viewBox="0 0 1060 1060">
|
||||||
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__hover" style="fill:#fff;stroke:#eee;stroke-width:60px;"></path>
|
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__hover" style="fill:#fff;stroke:#ebedf0;stroke-width:60px;"></path>
|
||||||
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__layer" style="stroke:#13ce66;stroke-dashoffset:3140px;stroke-width:61px;"></path>
|
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__layer" style="stroke:#13ce66;stroke-dashoffset:3140px;stroke-width:61px;"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<div class="van-circle__text">0%</div>
|
<div class="van-circle__text">0%</div>
|
||||||
|
@ -44,7 +44,7 @@ export default {
|
|||||||
color="#13ce66"
|
color="#13ce66"
|
||||||
fill="#fff"
|
fill="#fff"
|
||||||
size="120px"
|
size="120px"
|
||||||
layer-color="#eee"
|
layer-color="#ebedf0"
|
||||||
:text="text"
|
:text="text"
|
||||||
:rate="rate"
|
:rate="rate"
|
||||||
:speed="100"
|
:speed="100"
|
||||||
|
@ -97,6 +97,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-col {
|
.demo-col {
|
||||||
.van-doc-demo-block {
|
.van-doc-demo-block {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
@ -107,7 +109,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-col {
|
.van-col {
|
||||||
color: #fff;
|
color: @white;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -78,7 +78,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import "../../../packages/style/var";
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-collapse {
|
.demo-collapse {
|
||||||
.van-collapse-item__content {
|
.van-collapse-item__content {
|
||||||
|
@ -70,6 +70,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-list {
|
.demo-list {
|
||||||
.van-cell {
|
.van-cell {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -80,7 +82,7 @@ export default {
|
|||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #666;
|
color: @gray-darker;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -104,6 +104,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-popup {
|
.demo-popup {
|
||||||
.van-button {
|
.van-button {
|
||||||
margin: 10px 0 10px 15px;
|
margin: 10px 0 10px 15px;
|
||||||
@ -129,11 +131,11 @@ export default {
|
|||||||
.van-tab__pane:not(:first-child) {
|
.van-tab__pane:not(:first-child) {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
color: #666;
|
color: @gray-darker;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--top {
|
&--top {
|
||||||
color: #fff;
|
color: @white;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
@ -65,6 +65,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-style {
|
.demo-style {
|
||||||
.van-ellipsis {
|
.van-ellipsis {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@ -74,7 +76,7 @@ export default {
|
|||||||
|
|
||||||
.van-hairline--top {
|
.van-hairline--top {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
top: 5px;
|
top: 5px;
|
||||||
@ -83,7 +85,7 @@ export default {
|
|||||||
|
|
||||||
.van-col {
|
.van-col {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
color: #fff;
|
color: @white;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hairline(@border-color: #eee) {
|
.hairline(@border-color: #ebedf0) {
|
||||||
.hairline-common();
|
.hairline-common();
|
||||||
|
|
||||||
top: -50%;
|
top: -50%;
|
||||||
@ -16,7 +16,7 @@
|
|||||||
border: 0 solid @border-color;
|
border: 0 solid @border-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hairline-bottom(@border-color: #eee, @left: 0) {
|
.hairline-bottom(@border-color: #ebedf0, @left: 0) {
|
||||||
.hairline-common();
|
.hairline-common();
|
||||||
|
|
||||||
left: @left;
|
left: @left;
|
||||||
|
@ -124,6 +124,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-swipe {
|
.demo-swipe {
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
|
|
||||||
@ -131,7 +133,7 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
color: #fff;
|
color: @white;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 150px;
|
line-height: 150px;
|
||||||
@ -151,7 +153,7 @@ export default {
|
|||||||
display: block;
|
display: block;
|
||||||
padding: 30px 60px;
|
padding: 30px 60px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,7 +172,7 @@ export default {
|
|||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #fff;
|
color: @white;
|
||||||
background: rgba(0, 0, 0, .1);
|
background: rgba(0, 0, 0, .1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-tab {
|
.demo-tab {
|
||||||
margin-bottom: 300px;
|
margin-bottom: 300px;
|
||||||
|
|
||||||
@ -185,7 +187,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-tab__pane {
|
.van-tab__pane {
|
||||||
background-color: #fff;
|
background-color: @white;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import create from '../utils/create';
|
import create from '../utils/create';
|
||||||
import { RED, BLUE, GREEN } from '../utils/color';
|
import { RED, BLUE, GREEN, GRAY_DARK } from '../utils/color';
|
||||||
|
|
||||||
const DEFAULT_COLOR = '#999';
|
|
||||||
const COLOR_MAP = {
|
const COLOR_MAP = {
|
||||||
danger: RED,
|
danger: RED,
|
||||||
primary: BLUE,
|
primary: BLUE,
|
||||||
@ -39,7 +38,7 @@ export default create({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
style() {
|
style() {
|
||||||
const color = this.color || COLOR_MAP[this.type] || DEFAULT_COLOR;
|
const color = this.color || COLOR_MAP[this.type] || GRAY_DARK;
|
||||||
const key = this.plain ? 'color' : 'backgroundColor';
|
const key = this.plain ? 'color' : 'backgroundColor';
|
||||||
return { [key]: color };
|
return { [key]: color };
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
exports[`renders demo correctly 1`] = `
|
exports[`renders demo correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div><span class="van-tag" style="background-color:#999;">标签</span> <span class="van-tag" style="background-color:#f44;">标签</span> <span class="van-tag" style="background-color:#1989fa;">标签</span> <span class="van-tag" style="background-color:#4b0;">标签</span></div>
|
<div><span class="van-tag" style="background-color:#969799;">标签</span> <span class="van-tag" style="background-color:#f44;">标签</span> <span class="van-tag" style="background-color:#1989fa;">标签</span> <span class="van-tag" style="background-color:#4b0;">标签</span></div>
|
||||||
<div><span class="van-tag van-tag--plain van-hairline--surround" style="color:#999;">标签</span> <span class="van-tag van-tag--plain van-tag--round van-hairline--surround" style="color:#f44;">
|
<div><span class="van-tag van-tag--plain van-hairline--surround" style="color:#969799;">标签</span> <span class="van-tag van-tag--plain van-tag--round van-hairline--surround" style="color:#f44;">
|
||||||
标签
|
标签
|
||||||
</span> <span class="van-tag van-tag--plain van-tag--round van-hairline--surround" style="color:#1989fa;">
|
</span> <span class="van-tag van-tag--plain van-tag--round van-hairline--surround" style="color:#1989fa;">
|
||||||
标签
|
标签
|
||||||
</span> <span class="van-tag van-tag--plain van-hairline--surround" style="color:#4b0;">
|
</span> <span class="van-tag van-tag--plain van-hairline--surround" style="color:#4b0;">
|
||||||
标签
|
标签
|
||||||
</span></div>
|
</span></div>
|
||||||
<div><span class="van-tag van-tag--round" style="background-color:#999;">标签</span> <span class="van-tag van-tag--round" style="background-color:#f44;">
|
<div><span class="van-tag van-tag--round" style="background-color:#969799;">标签</span> <span class="van-tag van-tag--round" style="background-color:#f44;">
|
||||||
标签
|
标签
|
||||||
</span> <span class="van-tag van-tag--round" style="background-color:#1989fa;">
|
</span> <span class="van-tag van-tag--round" style="background-color:#1989fa;">
|
||||||
标签
|
标签
|
||||||
</span> <span class="van-tag van-tag--round" style="background-color:#4b0;">
|
</span> <span class="van-tag van-tag--round" style="background-color:#4b0;">
|
||||||
标签
|
标签
|
||||||
</span></div>
|
</span></div>
|
||||||
<div><span class="van-tag van-tag--mark" style="background-color:#999;">标签</span> <span class="van-tag van-tag--mark" style="background-color:#f44;">
|
<div><span class="van-tag van-tag--mark" style="background-color:#969799;">标签</span> <span class="van-tag van-tag--mark" style="background-color:#f44;">
|
||||||
标签
|
标签
|
||||||
</span> <span class="van-tag van-tag--mark" style="background-color:#1989fa;">
|
</span> <span class="van-tag van-tag--mark" style="background-color:#1989fa;">
|
||||||
标签
|
标签
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
export const RED = '#f44';
|
export const RED = '#f44';
|
||||||
export const BLUE = '#1989fa';
|
export const BLUE = '#1989fa';
|
||||||
export const GREEN = '#4b0';
|
export const GREEN = '#4b0';
|
||||||
|
export const GRAY_DARK = '#969799';
|
||||||
|
@ -55,17 +55,19 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import '../../style/var';
|
||||||
|
|
||||||
.demo-waterfall {
|
.demo-waterfall {
|
||||||
ul {
|
ul {
|
||||||
max-height: 360px;
|
max-height: 360px;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
border-top: 1px solid #e5e5e5;
|
border-top: 1px solid @gray-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
border-bottom: 1px solid #e5e5e5;
|
border-bottom: 1px solid @gray-light;
|
||||||
background: #fff;
|
background: @white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +76,7 @@ export default {
|
|||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #666;
|
color: @gray-darker;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user