mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
* perf: remove CSS variables polyfill * style: fix missing calc value * perf: reduce some useless css vars
96 lines
1.9 KiB
Plaintext
96 lines
1.9 KiB
Plaintext
@import '../common/style/var.less';
|
|
|
|
:host {
|
|
font-size: 0;
|
|
line-height: 1;
|
|
}
|
|
|
|
.van-loading {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--loading-spinner-color, @loading-spinner-color);
|
|
|
|
&__spinner {
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
width: var(--loading-spinner-size, @loading-spinner-size);
|
|
// compatible for 0.x, users may set width or height in root element
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
height: var(--loading-spinner-size, @loading-spinner-size);
|
|
animation: van-rotate
|
|
var(
|
|
--loading-spinner-animation-duration,
|
|
@loading-spinner-animation-duration
|
|
)
|
|
linear infinite;
|
|
|
|
&--spinner {
|
|
animation-timing-function: steps(12);
|
|
}
|
|
|
|
&--circular {
|
|
border: 1px solid transparent;
|
|
border-top-color: currentColor;
|
|
border-radius: 100%;
|
|
}
|
|
}
|
|
|
|
&__text {
|
|
margin-left: var(--padding-xs, @padding-xs);
|
|
color: var(--loading-text-color, @loading-text-color);
|
|
font-size: var(--loading-text-font-size, @loading-text-font-size);
|
|
line-height: var(--loading-text-line-height, @loading-text-line-height);
|
|
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
&--vertical {
|
|
flex-direction: column;
|
|
|
|
.van-loading__text {
|
|
margin: var(--padding-xs, @padding-xs) 0 0;
|
|
}
|
|
}
|
|
|
|
&__dot {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
&::before {
|
|
display: block;
|
|
width: 2px;
|
|
height: 25%;
|
|
margin: 0 auto;
|
|
background-color: currentColor;
|
|
border-radius: 40%;
|
|
content: ' ';
|
|
}
|
|
}
|
|
}
|
|
|
|
.generate(@n, @i: 1) when (@i =< @n) {
|
|
.van-loading__dot:nth-of-type(@{i}) {
|
|
transform: rotate(@i * 30deg);
|
|
opacity: 1 - (0.75 / 12) * (@i - 1);
|
|
}
|
|
.generate(@n, (@i + 1));
|
|
}
|
|
.generate(12);
|
|
|
|
@keyframes van-rotate {
|
|
from {
|
|
transform: rotate(0deg);
|
|
}
|
|
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|