mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Improvement] upgrade to precss 3.0 (#1696)
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
&__title {
|
||||
max-height: 40px;
|
||||
|
||||
@mixin multi-ellipsis 2;
|
||||
@include multi-ellipsis(2);
|
||||
}
|
||||
|
||||
&__desc {
|
||||
@@ -66,7 +66,7 @@
|
||||
font-size: 12px;
|
||||
max-height: 20px;
|
||||
|
||||
@mixin ellipsis;
|
||||
@include ellipsis;
|
||||
}
|
||||
|
||||
&__price,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
@import '../mixins/clearfix.css';
|
||||
|
||||
.van-clearfix {
|
||||
@mixin clearfix;
|
||||
@include clearfix;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
@import '../mixins/ellipsis.css';
|
||||
|
||||
.van-ellipsis {
|
||||
@mixin ellipsis;
|
||||
@include ellipsis;
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
@import "../mixins/border-retina.css";
|
||||
@import "../mixins/hairline.css";
|
||||
|
||||
[class*='van-hairline'] {
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
@mixin hairline;
|
||||
@include hairline;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@
|
||||
h2 {
|
||||
margin: 0;
|
||||
|
||||
@mixin ellipsis;
|
||||
@include ellipsis;
|
||||
}
|
||||
|
||||
h2 {
|
||||
|
@@ -1,34 +0,0 @@
|
||||
@import '../common/var.css';
|
||||
|
||||
$border-poses: top, right, bottom, left;
|
||||
|
||||
@define-mixin border-retina $poses: $border-poses, $border-retina-color: $border-color {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
transform: scale(.5);
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
box-sizing: border-box;
|
||||
|
||||
@each $pos in $poses {
|
||||
border-$(pos): 1px solid $border-retina-color;
|
||||
}
|
||||
}
|
||||
|
||||
@define-mixin hairline $border-retina-color: $border-color {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
transform: scale(.5);
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
box-sizing: border-box;
|
||||
border: 0 solid $border-retina-color;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
@define-mixin clearfix {
|
||||
@mixin clearfix {
|
||||
&::after {
|
||||
content: '';
|
||||
display: table;
|
||||
|
@@ -1,13 +1,13 @@
|
||||
@define-mixin multi-ellipsis $lines {
|
||||
overflow : hidden;
|
||||
@mixin multi-ellipsis($lines) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: $lines;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
@define-mixin ellipsis {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@mixin ellipsis {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
13
packages/vant-css/src/mixins/hairline.css
Normal file
13
packages/vant-css/src/mixins/hairline.css
Normal file
@@ -0,0 +1,13 @@
|
||||
@mixin hairline($border-color: #e5e5e5) {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
transform: scale(0.5);
|
||||
transform-origin: 0 0;
|
||||
pointer-events: none;
|
||||
box-sizing: border-box;
|
||||
border: 0 solid $border-color;
|
||||
}
|
Reference in New Issue
Block a user