[improvement] rename packages dir to src (#3659)
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
@keyframes van-slide-up-enter {
|
||||
from {
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-up-leave {
|
||||
to {
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-down-enter {
|
||||
from {
|
||||
transform: translate3d(0, -100%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-down-leave {
|
||||
to {
|
||||
transform: translate3d(0, -100%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-left-enter {
|
||||
from {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-left-leave {
|
||||
to {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-right-enter {
|
||||
from {
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-slide-right-leave {
|
||||
to {
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-fade-out {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.van-fade {
|
||||
&-enter-active {
|
||||
animation: .3s van-fade-in;
|
||||
}
|
||||
|
||||
&-leave-active {
|
||||
animation: .3s van-fade-out;
|
||||
}
|
||||
}
|
||||
|
||||
.van-slide-up {
|
||||
&-enter-active {
|
||||
animation: van-slide-up-enter .3s both ease;
|
||||
}
|
||||
|
||||
&-leave-active {
|
||||
animation: van-slide-up-leave .3s both ease;
|
||||
}
|
||||
}
|
||||
|
||||
.van-slide-down {
|
||||
&-enter-active {
|
||||
animation: van-slide-down-enter .3s both ease;
|
||||
}
|
||||
|
||||
&-leave-active {
|
||||
animation: van-slide-down-leave .3s both ease;
|
||||
}
|
||||
}
|
||||
|
||||
.van-slide-left {
|
||||
&-enter-active {
|
||||
animation: van-slide-left-enter .3s both ease;
|
||||
}
|
||||
|
||||
&-leave-active {
|
||||
animation: van-slide-left-leave .3s both ease;
|
||||
}
|
||||
}
|
||||
|
||||
.van-slide-right {
|
||||
&-enter-active {
|
||||
animation: van-slide-right-enter .3s both ease;
|
||||
}
|
||||
|
||||
&-leave-active {
|
||||
animation: van-slide-right-leave .3s both ease;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Entry of basic styles
|
||||
*/
|
||||
|
||||
@import './var';
|
||||
@import './normalize';
|
||||
@import './ellipsis';
|
||||
@import './clearfix';
|
||||
@import './hairline';
|
||||
@import './animation';
|
||||
@import '../info/index';
|
||||
@import '../icon/index';
|
||||
@import '../loading/index';
|
||||
@import '../button/index';
|
||||
@import '../cell/index';
|
||||
@import '../cell-group/index';
|
||||
@import '../overlay/index';
|
||||
@@ -0,0 +1,5 @@
|
||||
@import './mixins/clearfix';
|
||||
|
||||
.van-clearfix {
|
||||
.clearfix();
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<demo-section>
|
||||
<demo-block :title="$t('ellipsis')">
|
||||
<div class="van-ellipsis">{{ $t('text') }}</div>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('hairline')">
|
||||
<div class="van-hairline--top" />
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('animation')">
|
||||
<van-cell
|
||||
is-link
|
||||
title="Fade"
|
||||
@click="animate('van-fade')"
|
||||
/>
|
||||
<van-cell
|
||||
is-link
|
||||
title="Slide Up"
|
||||
@click="animate('van-slide-up')"
|
||||
/>
|
||||
<van-cell
|
||||
is-link
|
||||
title="Slide Down"
|
||||
@click="animate('van-slide-down')"
|
||||
/>
|
||||
<van-cell
|
||||
is-link
|
||||
title="Slide Left"
|
||||
@click="animate('van-slide-left')"
|
||||
/>
|
||||
<van-cell
|
||||
is-link
|
||||
title="Slide Right"
|
||||
@click="animate('van-slide-right')"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<transition :name="transitionName">
|
||||
<div
|
||||
v-show="show"
|
||||
class="demo-animate-block"
|
||||
/>
|
||||
</transition>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
hairline: '1px 边框',
|
||||
ellipsis: '文字省略',
|
||||
animation: '动画',
|
||||
toggle: '切换动画',
|
||||
text: '这是一段宽度限制 250px 的文字,后面的内容会省略'
|
||||
},
|
||||
'en-US': {
|
||||
hairline: 'Hairline',
|
||||
ellipsis: 'Text Ellipsis',
|
||||
animation: 'Animation',
|
||||
toggle: 'Switch animation',
|
||||
text: 'This is a paragraph of 250px width limit, the back will be omitted.'
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
transitionName: ''
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
animate(transitionName) {
|
||||
this.show = true;
|
||||
this.transitionName = transitionName;
|
||||
|
||||
setTimeout(() => {
|
||||
this.show = false;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '../../style/var';
|
||||
|
||||
.demo-style {
|
||||
.van-ellipsis {
|
||||
max-width: 250px;
|
||||
margin-left: 15px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.van-hairline--top {
|
||||
height: 30px;
|
||||
background-color: @white;
|
||||
|
||||
&::after {
|
||||
top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-animate-block {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: -50px 0 0 -50px;
|
||||
background-color: @blue;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
@import './mixins/ellipsis';
|
||||
|
||||
.van-ellipsis {
|
||||
.ellipsis();
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
# Built-in Style
|
||||
|
||||
### Intro
|
||||
|
||||
Vant contains some common styles that can be used directly by the className.
|
||||
|
||||
### Text ellipsis
|
||||
|
||||
When the text content length exceeds the maximum container width, the excess text is automatically omitted.
|
||||
|
||||
```html
|
||||
<div class="van-ellipsis">
|
||||
This is a paragraph of 250px width limit, the back will be omitted.
|
||||
</div>
|
||||
```
|
||||
|
||||
### Hairline
|
||||
|
||||
Add 1px border under the Retina screen for the element, based on a pseudo element.
|
||||
|
||||
```html
|
||||
<!-- border top -->
|
||||
<div class="van-hairline--top"></div>
|
||||
|
||||
<!-- border bottom -->
|
||||
<div class="van-hairline--bottom"></div>
|
||||
|
||||
<!-- border left -->
|
||||
<div class="van-hairline--left"></div>
|
||||
|
||||
<!-- border right -->
|
||||
<div class="van-hairline--right"></div>
|
||||
|
||||
<!-- border top & bottom -->
|
||||
<div class="van-hairline--top-bottom"></div>
|
||||
|
||||
<!-- full border -->
|
||||
<div class="van-hairline--surround"></div>
|
||||
```
|
||||
|
||||
### Animation
|
||||
|
||||
```html
|
||||
<!-- fade in -->
|
||||
<transition name="van-fade">
|
||||
<div v-show="visible">Fade</div>
|
||||
</transition>
|
||||
|
||||
<!-- slide up -->
|
||||
<transition name="van-slide-up">
|
||||
<div v-show="visible">Slide Up</div>
|
||||
</transition>
|
||||
|
||||
<!-- slide down -->
|
||||
<transition name="van-slide-down">
|
||||
<div v-show="visible">Slide Down</div>
|
||||
</transition>
|
||||
|
||||
<!-- slide left -->
|
||||
<transition name="van-slide-left">
|
||||
<div v-show="visible">Slide Left</div>
|
||||
</transition>
|
||||
|
||||
<!-- slide right -->
|
||||
<transition name="van-slide-right">
|
||||
<div v-show="visible">Slide Right</div>
|
||||
</transition>
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
@import './mixins/hairline';
|
||||
|
||||
[class*='van-hairline'] {
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
.hairline();
|
||||
}
|
||||
}
|
||||
|
||||
.van-hairline {
|
||||
&--top::after {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
&--left::after {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
&--right::after {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
&--bottom::after {
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
&--top-bottom::after {
|
||||
border-width: 1px 0;
|
||||
}
|
||||
|
||||
&--surround::after {
|
||||
border-width: 1px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.clearfix() {
|
||||
&::after {
|
||||
display: table;
|
||||
clear: both;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
.multi-ellipsis(@lines) {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: @lines;
|
||||
|
||||
/* autoprefixer: ignore next */
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.ellipsis() {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
.hairline-common() {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.hairline(@border-color: #ebedf0) {
|
||||
.hairline-common();
|
||||
|
||||
top: -50%;
|
||||
right: -50%;
|
||||
bottom: -50%;
|
||||
left: -50%;
|
||||
border: 0 solid @border-color;
|
||||
transform: scale(0.5);
|
||||
}
|
||||
|
||||
.hairline-bottom(@border-color: #ebedf0, @left: 0) {
|
||||
.hairline-common();
|
||||
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: @left;
|
||||
border-bottom: 1px solid @border-color;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Normalize
|
||||
*/
|
||||
|
||||
html {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a,
|
||||
input,
|
||||
button,
|
||||
textarea,
|
||||
[class*='van-'] {
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
textarea {
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
@import './var';
|
||||
|
||||
html,
|
||||
body,
|
||||
div,
|
||||
span,
|
||||
applet,
|
||||
object,
|
||||
iframe,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
p,
|
||||
blockquote,
|
||||
pre,
|
||||
a,
|
||||
abbr,
|
||||
acronym,
|
||||
address,
|
||||
big,
|
||||
cite,
|
||||
code,
|
||||
del,
|
||||
dfn,
|
||||
em,
|
||||
img,
|
||||
ins,
|
||||
kbd,
|
||||
q,
|
||||
s,
|
||||
samp,
|
||||
small,
|
||||
strike,
|
||||
strong,
|
||||
sub,
|
||||
sup,
|
||||
tt,
|
||||
var,
|
||||
b,
|
||||
u,
|
||||
i,
|
||||
center,
|
||||
dl,
|
||||
dt,
|
||||
dd,
|
||||
ol,
|
||||
ul,
|
||||
li,
|
||||
fieldset,
|
||||
form,
|
||||
label,
|
||||
legend,
|
||||
table,
|
||||
caption,
|
||||
tbody,
|
||||
tfoot,
|
||||
thead,
|
||||
tr,
|
||||
th,
|
||||
td,
|
||||
article,
|
||||
aside,
|
||||
canvas,
|
||||
details,
|
||||
embed,
|
||||
figure,
|
||||
figcaption,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
menu,
|
||||
nav,
|
||||
output,
|
||||
ruby,
|
||||
section,
|
||||
summary,
|
||||
time,
|
||||
mark,
|
||||
audio,
|
||||
video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font: inherit;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
line-height: 1;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
caption,
|
||||
th,
|
||||
td {
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
q,
|
||||
blockquote {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
q::before,
|
||||
q::after,
|
||||
blockquote::before,
|
||||
blockquote::after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
menu,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
body {
|
||||
color: @text-color;
|
||||
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
|
||||
background-color: @background-color;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
button,
|
||||
input[type='number'],
|
||||
input[type='text'],
|
||||
input[type='password'],
|
||||
input[type='email'],
|
||||
input[type='search'],
|
||||
select,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
@@ -0,0 +1,592 @@
|
||||
// Color variables
|
||||
@black: #000;
|
||||
@white: #fff;
|
||||
@red: #f44;
|
||||
@blue: #1989fa;
|
||||
@orange: #ff976a;
|
||||
@orange-dark: #ed6a0c;
|
||||
@orange-light: #fffbe8;
|
||||
@green: #07c160;
|
||||
@gray: #c8c9cc;
|
||||
@gray-light: #e5e5e5;
|
||||
@gray-darker: #7d7e80;
|
||||
@gray-dark: #969799;
|
||||
|
||||
// Default colors
|
||||
@text-color: #323233;
|
||||
@border-color: #ebedf0;
|
||||
@active-color: #f2f3f5;
|
||||
@background-color: #f8f8f8;
|
||||
@background-color-light: #fafafa;
|
||||
|
||||
// ActionSheet
|
||||
@action-sheet-max-height: 90%;
|
||||
@action-sheet-header-height: 44px;
|
||||
@action-sheet-header-font-size: 16px;
|
||||
@action-sheet-item-height: 50px;
|
||||
@action-sheet-item-background: @white;
|
||||
@action-sheet-item-font-size: 16px;
|
||||
@action-sheet-item-text-color: @text-color;
|
||||
@action-sheet-subname-color: @gray-darker;
|
||||
@action-sheet-subname-font-size: 12px;
|
||||
@action-sheet-close-icon-size: 18px;
|
||||
@action-sheet-close-icon-color: @gray-dark;
|
||||
|
||||
// AddressEdit
|
||||
@address-edit-buttons-padding: 30px 15px;
|
||||
@address-edit-button-margin-bottom: 15px;
|
||||
@address-edit-detail-finish-color: @blue;
|
||||
@address-edit-detail-fnish-font-size: 12px;
|
||||
|
||||
// AddressList
|
||||
@address-list-disabled-text-color: @gray-dark;
|
||||
@address-list-disabled-text-font-size: 12px;
|
||||
@address-list-disabled-text-line-height: 30px;
|
||||
@address-list-add-button-z-index: 9999;
|
||||
@address-list-item-padding: 15px;
|
||||
@address-list-item-text-color: @gray-darker;
|
||||
@address-list-item-disabled-text-color: @gray-dark;
|
||||
@address-list-item-font-size: 12px;
|
||||
@address-list-item-line-height: 16px;
|
||||
@address-list-edit-icon-size: 16px;
|
||||
|
||||
// Button
|
||||
@button-mini-height: 22px;
|
||||
@button-mini-min-width: 50px;
|
||||
@button-mini-font-size: 10px;
|
||||
@button-mini-line-height: 20px;
|
||||
@button-small-height: 30px;
|
||||
@button-small-font-size: 12px;
|
||||
@button-small-min-width: 60px;
|
||||
@button-small-line-height: 28px;
|
||||
@button-normal-font-size: 14px;
|
||||
@button-large-height: 50px;
|
||||
@button-large-line-height: 48px;
|
||||
@button-default-height: 44px;
|
||||
@button-default-line-height: 42px;
|
||||
@button-default-font-size: 16px;
|
||||
@button-default-color: @text-color;
|
||||
@button-default-background-color: @white;
|
||||
@button-default-border-color: @border-color;
|
||||
@button-primary-color: @white;
|
||||
@button-primary-background-color: @green;
|
||||
@button-primary-border-color: @green;
|
||||
@button-info-color: @white;
|
||||
@button-info-background-color: @blue;
|
||||
@button-info-border-color: @blue;
|
||||
@button-danger-color: @white;
|
||||
@button-danger-background-color: @red;
|
||||
@button-danger-border-color: @red;
|
||||
@button-warning-color: @white;
|
||||
@button-warning-background-color: @orange;
|
||||
@button-warning-border-color: @orange;
|
||||
@button-border-width: 1px;
|
||||
@button-border-radius: 2px;
|
||||
@button-round-border-radius: 10em;
|
||||
@button-plain-background-color: @white;
|
||||
@button-disabled-opacity: .5;
|
||||
|
||||
// Card
|
||||
@card-padding: 5px 15px;
|
||||
@card-font-size: 12px;
|
||||
@card-text-color: @text-color;
|
||||
@card-background-color: @background-color-light;
|
||||
@card-thumb-size: 90px;
|
||||
@card-title-line-height: 16px;
|
||||
@card-desc-color: @gray-darker;
|
||||
@card-desc-line-height: 20px;
|
||||
@card-price-color: @red;
|
||||
@card-origin-price-color: @gray-darker;
|
||||
@card-origin-price-font-size: 10px;
|
||||
|
||||
// Cell
|
||||
@cell-font-size: 14px;
|
||||
@cell-line-height: 24px;
|
||||
@cell-vertical-padding: 10px;
|
||||
@cell-horizontal-padding: 15px;
|
||||
@cell-text-color: @text-color;
|
||||
@cell-background-color: @white;
|
||||
@cell-border-color: @border-color;
|
||||
@cell-active-color: @active-color;
|
||||
@cell-required-color: @red;
|
||||
@cell-label-color: @gray-dark;
|
||||
@cell-label-font-size: 12px;
|
||||
@cell-label-line-height: 18px;
|
||||
@cell-label-margin-top: 3px;
|
||||
@cell-value-color: @gray-dark;
|
||||
@cell-icon-size: 16px;
|
||||
@cell-right-icon-color: @gray-dark;
|
||||
@cell-large-vertical-padding: 12px;
|
||||
@cell-large-title-font-size: 16px;
|
||||
@cell-large-label-font-size: 14px;
|
||||
|
||||
// CellGroup
|
||||
@cell-group-background-color: @white;
|
||||
@cell-group-title-color: @gray-dark;
|
||||
@cell-group-title-padding: 15px 15px 5px;
|
||||
@cell-group-title-font-size: 14px;
|
||||
@cell-group-title-line-height: 16px;
|
||||
|
||||
// Checkbox
|
||||
@checkbox-size: 20px;
|
||||
@checkbox-border-color: @gray-light;
|
||||
@checkbox-transition-duration: .2s;
|
||||
@checkbox-label-margin: 10px;
|
||||
@checkbox-label-color: @text-color;
|
||||
@checkbox-checked-icon-color: @blue;
|
||||
@checkbox-disabled-icon-color: @gray;
|
||||
@checkbox-disabled-label-color: @gray;
|
||||
@checkbox-disabled-background-color: @border-color;
|
||||
|
||||
// Circle
|
||||
@circle-text-color: @text-color;
|
||||
|
||||
// Collapse
|
||||
@collapse-item-transition-duration: .3s;
|
||||
@collapse-item-content-padding: 15px;
|
||||
@collapse-item-content-font-size: 13px;
|
||||
@collapse-item-content-line-height: 1.5;
|
||||
@collapse-item-content-text-color: @gray-dark;
|
||||
@collapse-item-content-background-color: @white;
|
||||
@collapse-item-title-disabled-color: @gray;
|
||||
|
||||
// ContactCard
|
||||
@contact-card-padding: 15px;
|
||||
@contact-card-add-icon-size: 40px;
|
||||
@contact-card-add-icon-color: @blue;
|
||||
@contact-card-value-line-height: 20px;
|
||||
|
||||
// ContactEdit
|
||||
@contact-edit-buttons-padding: 30px 15px;
|
||||
@contact-edit-button-margin-bottom: 15px;
|
||||
@contact-edit-field-label-width: 65px;
|
||||
|
||||
// ContactList
|
||||
@contact-list-edit-icon-size: 16px;
|
||||
@contact-list-add-button-z-index: 9999;
|
||||
@contact-list-item-padding: 15px;
|
||||
|
||||
// Coupon
|
||||
@coupon-margin: 0 15px 15px;
|
||||
@coupon-content-height: 100px;
|
||||
@coupon-content-padding: 24px 0 0 15px;
|
||||
@coupon-background-color: @white;
|
||||
@coupon-active-background-color: @active-color;
|
||||
@coupon-border-radius: 4px;
|
||||
@coupon-box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
|
||||
@coupon-head-width: 85px;
|
||||
@coupon-amount-color: @red;
|
||||
@coupon-amount-font-size: 24px;
|
||||
@coupon-currency-font-size: 50%;
|
||||
@coupon-name-font-size: 16px;
|
||||
@coupon-disabled-text-color: @gray-dark;
|
||||
@coupon-description-padding: 7px 15px;
|
||||
@coupon-description-background-color: @background-color-light;
|
||||
@coupon-description-border-color: @border-color;
|
||||
|
||||
// CouponCell
|
||||
@coupon-cell-selected-text-color: @text-color;
|
||||
|
||||
// CouponList
|
||||
@coupon-list-background-color: @background-color;
|
||||
@coupon-list-field-padding: 7px 15px;
|
||||
@coupon-list-exchange-button-height: 32px;
|
||||
@coupon-list-empty-image-size: 200px;
|
||||
@coupon-list-empty-tip-color: @gray-dark;
|
||||
@coupon-list-empty-tip-font-size: 14px;
|
||||
@coupon-list-empty-tip-line-height: 20px;
|
||||
|
||||
// Dialog
|
||||
@dialog-width: 85%;
|
||||
@dialog-font-size: 16px;
|
||||
@dialog-transition: .3s;
|
||||
@dialog-border-radius: 4px;
|
||||
@dialog-background-color: @white;
|
||||
@dialog-header-font-weight: 500;
|
||||
@dialog-header-padding-top: 25px;
|
||||
@dialog-header-isolated-padding: 25px 0;
|
||||
@dialog-message-padding: 25px;
|
||||
@dialog-message-font-size: 14px;
|
||||
@dialog-message-line-height: 1.5;
|
||||
@dialog-message-max-height: 60vh;
|
||||
@dialog-has-title-message-text-color: @gray-darker;
|
||||
@dialog-has-title-message-padding-top: 12px;
|
||||
@dialog-confirm-button-text-color: @blue;
|
||||
|
||||
// DropdownMenu
|
||||
@dropdown-menu-height: 50px;
|
||||
@dropdown-menu-background-color: @white;
|
||||
@dropdown-menu-title-font-size: 15px;
|
||||
|
||||
// Field
|
||||
@field-label-width: 90px;
|
||||
@field-input-text-color: @text-color;
|
||||
@field-input-error-text-color: @red;
|
||||
@field-input-disabled-text-color: @gray-dark;
|
||||
@field-placeholder-text-color: @gray-dark;
|
||||
@field-icon-size: 16px;
|
||||
@field-clear-icon-size: 16px;
|
||||
@field-clear-icon-color: @gray;
|
||||
@field-right-icon-color: @gray-dark;
|
||||
@field-error-message-color: @red;
|
||||
@field-error-message-text-color: 12px;
|
||||
@field-text-area-min-height: 60px;
|
||||
|
||||
// GoodsAction
|
||||
@goods-action-background-color: @white;
|
||||
@goods-action-icon-width: 15%;
|
||||
@goods-action-icon-height: 50px;
|
||||
@goods-action-icon-color: @gray-darker;
|
||||
@goods-action-icon-size: 20px;
|
||||
@goods-action-icon-font-size: 10px;
|
||||
@goods-action-icon-active-color: @active-color;
|
||||
|
||||
// IndexAnchor
|
||||
@index-anchor-padding: 0 15px;
|
||||
@index-anchor-text-color: @text-color;
|
||||
@index-anchor-font-weight: 500;
|
||||
@index-anchor-font-size: 14px;
|
||||
@index-anchor-line-height: 32px;
|
||||
@index-anchor-background-color: transparent;
|
||||
@index-anchor-sticky-background-color: @white;
|
||||
|
||||
// IndexBar
|
||||
@index-bar-index-font-size: 10px;
|
||||
@index-bar-index-line-height: 14px;
|
||||
|
||||
// Info
|
||||
@info-size: 16px;
|
||||
@info-color: @white;
|
||||
@info-padding: 0 3px;
|
||||
@info-font-size: 12px;
|
||||
@info-font-weight: 500;
|
||||
@info-border-width: 1px;
|
||||
@info-background-color: @red;
|
||||
@info-font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
|
||||
|
||||
// Image
|
||||
@image-placeholder-text-color: @gray-dark;
|
||||
@image-placeholder-font-size: 14px;
|
||||
@image-placeholder-background-color: @background-color;
|
||||
|
||||
// ImagePreview
|
||||
@image-preview-index-text-color: @white;
|
||||
@image-preview-index-font-size: 14px;
|
||||
@image-preview-overlay-background-color: rgba(0, 0, 0, .9);
|
||||
|
||||
// List
|
||||
@list-icon-margin-right: 5px;
|
||||
@list-text-color: @gray-dark;
|
||||
@list-text-font-size: 13px;
|
||||
@list-text-line-height: 50px;
|
||||
|
||||
// Loading
|
||||
@loading-text-color: @gray-dark;
|
||||
@loading-text-font-size: 14px;
|
||||
|
||||
// NavBar
|
||||
@nav-bar-height: 46px;
|
||||
@nav-bar-background-color: @white;
|
||||
@nav-bar-arrow-size: 16px;
|
||||
@nav-bar-icon-color: @blue;
|
||||
@nav-bar-text-color: @blue;
|
||||
@nav-bar-title-font-size: 16px;
|
||||
@nav-bar-title-text-color: @text-color;
|
||||
|
||||
// NoticeBar
|
||||
@notice-bar-height: 40px;
|
||||
@notice-bar-padding: 0 15px;
|
||||
@notice-bar-wrapable-padding: 8px 15px;
|
||||
@notice-bar-text-color: @orange-dark;
|
||||
@notice-bar-font-size: 14px;
|
||||
@notice-bar-line-height: 24px;
|
||||
@notice-bar-background-color: @orange-light;
|
||||
@notice-bar-icon-size: 16px;
|
||||
@notice-bar-icon-min-width: 22px;
|
||||
|
||||
// Notify
|
||||
@notify-padding: 6px 15px;
|
||||
@notify-font-size: 14px;
|
||||
@notify-line-height: 20px;
|
||||
|
||||
// NumberKeyboard
|
||||
@number-keyboard-background-color: @white;
|
||||
@number-keyboard-key-height: 54px;
|
||||
@number-keyboard-key-background: #ebedf0;
|
||||
@number-keyboard-key-font-size: 24px;
|
||||
@number-keyboard-key-active-color: @active-color;
|
||||
@number-keyboard-delete-font-size: 16px;
|
||||
@number-keyboard-title-color: @gray-darker;
|
||||
@number-keyboard-title-height: 30px;
|
||||
@number-keyboard-title-font-size: 14px;
|
||||
@number-keyboard-close-padding: 0 15px;
|
||||
@number-keyboard-close-color: @blue;
|
||||
@number-keyboard-close-font-size: 14px;
|
||||
@number-keyboard-button-text-color: @white;
|
||||
@number-keyboard-button-background-color: @blue;
|
||||
|
||||
// Overlay
|
||||
@overlay-background-color: rgba(0, 0, 0, 0.7);
|
||||
|
||||
// Pagination
|
||||
@pagination-height: 40px;
|
||||
@pagination-font-size: 14px;
|
||||
@pagination-item-width: 36px;
|
||||
@pagination-item-default-color: @blue;
|
||||
@pagination-item-disabled-color: @gray-darker;
|
||||
@pagination-item-disabled-background-color: @background-color;
|
||||
@pagination-background-color: @white;
|
||||
@pagination-desc-color: @gray-darker;
|
||||
@pagination-disabled-opacity: 0.6;
|
||||
|
||||
// Panel
|
||||
@panel-background-color: @white;
|
||||
@panel-header-value-color: @red;
|
||||
@panel-footer-padding: 10px 15px;
|
||||
|
||||
// PasswordInput
|
||||
@password-input-height: 50px;
|
||||
@password-input-margin: 0 15px;
|
||||
@password-input-font-size: 20px;
|
||||
@password-input-border-radius: 6px;
|
||||
@password-input-background-color: @white;
|
||||
@password-input-info-color: @gray-dark;
|
||||
@password-input-info-font-size: 14px;
|
||||
@password-input-error-info-color: @red;
|
||||
@password-input-dot-size: 10px;
|
||||
@password-input-dot-color: @black;
|
||||
|
||||
// Picker
|
||||
@picker-background-color: @white;
|
||||
@picker-toolbar-height: 44px;
|
||||
@picker-title-font-size: 16px;
|
||||
@picker-action-padding: 0 15px;
|
||||
@picker-action-font-size: 14px;
|
||||
@picker-action-text-color: @blue;
|
||||
@picker-action-active-color: @active-color;
|
||||
@picker-option-font-size: 16px;
|
||||
@picker-option-text-color: @black;
|
||||
@picker-option-disabled-opacity: .3;
|
||||
|
||||
// Popup
|
||||
@popup-background-color: @white;
|
||||
@popup-transition: .3s ease-out;
|
||||
|
||||
// Progress
|
||||
@progress-height: 4px;
|
||||
@progress-background-color: @gray-light;
|
||||
@progress-pivot-padding: 0 5px;
|
||||
@progress-pivot-font-size: 10px;
|
||||
@progress-pivot-line-height: 1.6;
|
||||
@progress-pivot-background-color: @gray-light;
|
||||
|
||||
// PullRefresh
|
||||
@pull-refresh-head-height: 50px;
|
||||
@pull-refresh-head-font-size: 14px;
|
||||
@pull-refresh-head-text-color: @gray-dark;
|
||||
|
||||
// Radio
|
||||
@radio-size: 20px;
|
||||
@radio-border-color: @gray-light;
|
||||
@radio-transition-duration: .2s;
|
||||
@radio-label-margin: 10px;
|
||||
@radio-label-color: @text-color;
|
||||
@radio-checked-icon-color: @blue;
|
||||
@radio-disabled-icon-color: @gray;
|
||||
@radio-disabled-label-color: @gray;
|
||||
@radio-disabled-background-color: @border-color;
|
||||
|
||||
// Rate
|
||||
@rate-icon-size: 20px;
|
||||
@rate-icon-gutter: 4px;
|
||||
|
||||
// Search
|
||||
@search-padding: 10px 16px;
|
||||
@search-background-color: #f7f8fA;
|
||||
@search-input-height: 34px;
|
||||
@search-label-padding: 0 5px;
|
||||
@search-label-color: @text-color;
|
||||
@search-label-font-size: 14px;
|
||||
@search-left-icon-color: @gray-dark;
|
||||
@search-action-padding: 0 10px;
|
||||
@search-action-text-color: @text-color;
|
||||
@search-action-font-size: 14px;
|
||||
|
||||
// Sidebar
|
||||
@sidebar-width: 85px;
|
||||
|
||||
// SidebarItem
|
||||
@sidebar-font-size: 14px;
|
||||
@sidebar-line-height: 1.4;
|
||||
@sidebar-text-color: @gray-darker;
|
||||
@sidebar-padding: 20px 12px 20px 9px;
|
||||
@sidebar-active-color: @active-color;
|
||||
@sidebar-background-color: @background-color;
|
||||
@sidebar-selected-font-weight: 500;
|
||||
@sidebar-selected-text-color: @text-color;
|
||||
@sidebar-selected-border-color: @red;
|
||||
@sidebar-selected-background-color: @white;
|
||||
|
||||
// Skeleton
|
||||
@skeleton-row-height: 16px;
|
||||
@skeleton-row-background-color: @active-color;
|
||||
@skeleton-row-margin-top: 12px;
|
||||
@skeleton-avatar-background-color: @active-color;
|
||||
@skeleton-animation-duration: 1.2s;
|
||||
|
||||
// Slider
|
||||
@slider-active-background-color: @blue;
|
||||
@slider-inactive-background-color: @gray-light;
|
||||
@slider-disabled-opacity: .3;
|
||||
@slider-button-width: 20px;
|
||||
@slider-button-height: 20px;
|
||||
@slider-button-border-radius: 50%;
|
||||
@slider-button-background-color: @white;
|
||||
@slider-button-box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
|
||||
|
||||
// Step
|
||||
@step-text-color: @gray-dark;
|
||||
@step-process-text-color: @text-color;
|
||||
@step-font-size: 14px;
|
||||
@step-line-color: @border-color;
|
||||
@step-finish-line-color: @green;
|
||||
@step-finish-text-color: @text-color;
|
||||
@step-icon-size: 12px;
|
||||
@step-circle-size: 5px;
|
||||
@step-circle-color: @gray-dark;
|
||||
@step-horizontal-title-font-size: 12px;
|
||||
|
||||
// Steps
|
||||
@steps-background-color: @white;
|
||||
|
||||
// Stepper
|
||||
@stepper-active-color: #e8e8e8;
|
||||
@stepper-background-color: @active-color;
|
||||
@stepper-button-icon-color: @text-color;
|
||||
@stepper-button-disabled-color: #f7f8fa;
|
||||
@stepper-button-disabled-icon-color: @gray;
|
||||
@stepper-input-width: 30px;
|
||||
@stepper-input-height: 26px;
|
||||
@stepper-input-font-size: 14px;
|
||||
@stepper-input-text-color: @text-color;
|
||||
@stepper-input-disabled-text-color: @gray;
|
||||
@stepper-input-disabled-background-color: @active-color;
|
||||
@stepper-border-radius: 4px;
|
||||
|
||||
// SubmitBar
|
||||
@submit-bar-height: 50px;
|
||||
@submit-bar-z-index: 100;
|
||||
@submit-bar-background-color: @white;
|
||||
@submit-bar-button-width: 110px;
|
||||
@submit-bar-price-color: @red;
|
||||
@submit-bar-price-font-size: 18px;
|
||||
@submit-bar-currency-font-size: 14px;
|
||||
@submit-bar-text-color: @text-color;
|
||||
@submit-bar-text-font-size: 14px;
|
||||
@submit-bar-tip-padding: 10px;
|
||||
@submit-bar-tip-font-size: 12px;
|
||||
@submit-bar-tip-line-height: 1.5;
|
||||
@submit-bar-tip-color: #f56723;
|
||||
@submit-bar-tip-background-color: #fff7cc;
|
||||
@submit-bar-tip-icon-size: 12px;
|
||||
|
||||
// Swipe
|
||||
@swipe-indicator-size: 6px;
|
||||
@swipe-indicator-margin: 10px;
|
||||
@swipe-indicator-active-opacity: 1;
|
||||
@swipe-indicator-inactive-opacity: .3;
|
||||
@swipe-indicator-active-background-color: @blue;
|
||||
@swipe-indicator-inactive-background-color: @border-color;
|
||||
|
||||
// Switch
|
||||
@switch-width: 2em;
|
||||
@switch-height: 1em;
|
||||
@switch-node-size: 1em;
|
||||
@switch-node-z-index: 1;
|
||||
@switch-node-background-color: @white;
|
||||
@switch-node-box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
|
||||
@switch-background-color: @white;
|
||||
@switch-on-background-color: @blue;
|
||||
@switch-transition-duration: .3s;
|
||||
@switch-disabled-opacity: .4;
|
||||
@switch-border: 1px solid rgba(0, 0, 0, .1);
|
||||
|
||||
// SwitchCell
|
||||
@switch-cell-padding-top: @cell-vertical-padding - 1px;
|
||||
@switch-cell-padding-bottom: @cell-vertical-padding -1px;
|
||||
@switch-cell-large-padding-top: @cell-large-vertical-padding - 1px;
|
||||
@switch-cell-large-padding-bottom: @cell-large-vertical-padding - 1px;
|
||||
|
||||
// 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;
|
||||
|
||||
// Tab
|
||||
@tab-text-color: @gray-darker;
|
||||
@tab-active-text-color: @text-color;
|
||||
@tab-disabled-text-color: @gray;
|
||||
@tab-font-size: 14px;
|
||||
|
||||
// Tabs
|
||||
@tabs-default-color: @red;
|
||||
@tabs-line-height: 44px;
|
||||
@tabs-card-height: 30px;
|
||||
@tabs-nav-background-color: @white;
|
||||
@tabs-bottom-bar-height: 3px;
|
||||
@tabs-bottom-bar-color: @tabs-default-color;
|
||||
|
||||
// Tag
|
||||
@tag-padding: .2em .5em;
|
||||
@tag-font-size: 10px;
|
||||
@tag-medium-font-size: 12px;
|
||||
@tag-large-font-size: 14px;
|
||||
@tag-text-color: @white;
|
||||
@tag-border-radius: .2em;
|
||||
@tag-round-border-radius: .8em;
|
||||
|
||||
// Toast
|
||||
@toast-max-width: 70%;
|
||||
@toast-font-size: 14px;
|
||||
@toast-text-color: @white;
|
||||
@toast-line-height: 20px;
|
||||
@toast-border-radius: 4px;
|
||||
@toast-background-color: rgba(@text-color, .88);
|
||||
@toast-icon-size: 40px;
|
||||
@toast-text-min-width: 96px;
|
||||
@toast-text-padding: 8px 12px;
|
||||
@toast-default-padding: 15px;
|
||||
@toast-default-width: 90px;
|
||||
@toast-default-min-height: 90px;
|
||||
@toast-position-top-distance: 50px;
|
||||
@toast-position-bottom-distance: 50px;
|
||||
|
||||
// TreeSelect
|
||||
@tree-select-font-size: 14px;
|
||||
@tree-select-nav-background-color: @background-color-light;
|
||||
@tree-select-content-background-color: @white;
|
||||
@tree-select-nav-item-padding: 0 9px 0 12px;
|
||||
@tree-select-nav-item-active-border-color: @red;
|
||||
@tree-select-nav-item-active-background-color: @white;
|
||||
@tree-select-nav-item-disabled-color: @gray-dark;
|
||||
@tree-select-item-height: 44px;
|
||||
@tree-select-item-active-color: @red;
|
||||
@tree-select-item-disabled-color: @gray;
|
||||
|
||||
// Uploader
|
||||
@uploader-size: 80px;
|
||||
@uploader-icon-size: 24px;
|
||||
@uploader-icon-color: @gray-dark;
|
||||
@uploader-text-color: @gray-dark;
|
||||
@uploader-text-font-size: 12px;
|
||||
@uploader-upload-border-color: @gray-light;
|
||||
@uploader-upload-background-color: @white;
|
||||
@uploader-delete-color: @white;
|
||||
@uploader-delete-background-color: rgba(0, 0, 0, .45);
|
||||
@@ -0,0 +1,68 @@
|
||||
# 内置样式
|
||||
|
||||
### 介绍
|
||||
|
||||
Vant 中默认包含了一些常用样式,可以直接通过 className 的方式使用。
|
||||
|
||||
### 文字省略
|
||||
|
||||
当文本内容长度超过容器最大宽度时,自动省略多余的文本。
|
||||
|
||||
```html
|
||||
<div class="van-ellipsis">这是一段宽度限制 250px 的文字,后面的内容会省略</div>
|
||||
```
|
||||
|
||||
### 1px 边框
|
||||
|
||||
为元素添加 Retina 屏幕下的 1px 边框(即 hairline),基于伪类 transform 实现。
|
||||
|
||||
```html
|
||||
<!-- 上边框 -->
|
||||
<div class="van-hairline--top"></div>
|
||||
|
||||
<!-- 下边框 -->
|
||||
<div class="van-hairline--bottom"></div>
|
||||
|
||||
<!-- 左边框 -->
|
||||
<div class="van-hairline--left"></div>
|
||||
|
||||
<!-- 右边框 -->
|
||||
<div class="van-hairline--right"></div>
|
||||
|
||||
<!-- 上下边框 -->
|
||||
<div class="van-hairline--top-bottom"></div>
|
||||
|
||||
<!-- 全边框 -->
|
||||
<div class="van-hairline--surround"></div>
|
||||
```
|
||||
|
||||
### 动画
|
||||
|
||||
可以通过 `transition` 组件使用内置的动画
|
||||
|
||||
```html
|
||||
<!-- 淡入 -->
|
||||
<transition name="van-fade">
|
||||
<div v-show="visible">Fade</div>
|
||||
</transition>
|
||||
|
||||
<!-- 上滑进入 -->
|
||||
<transition name="van-slide-up">
|
||||
<div v-show="visible">Slide Up</div>
|
||||
</transition>
|
||||
|
||||
<!-- 下滑进入 -->
|
||||
<transition name="van-slide-down">
|
||||
<div v-show="visible">Slide Down</div>
|
||||
</transition>
|
||||
|
||||
<!-- 左滑进入 -->
|
||||
<transition name="van-slide-left">
|
||||
<div v-show="visible">Slide Left</div>
|
||||
</transition>
|
||||
|
||||
<!-- 右滑进入 -->
|
||||
<transition name="van-slide-right">
|
||||
<div v-show="visible">Slide Right</div>
|
||||
</transition>
|
||||
```
|
||||
Reference in New Issue
Block a user