_text.scss
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* ==================
文本
==================== */
@use 'sass:math';
.font-0 {
font-size: 24rpx;
--textSize: -4rpx;
}
.font-1 {
font-size: 28rpx;
--textSize: 0rpx;
}
.font-2 {
font-size: 32rpx;
--textSize: 4rpx;
}
.font-3 {
font-size: 36rpx;
--textSize: 8rpx;
}
.font-4 {
font-size: 40rpx;
--textSize: 12rpx;
}
.text {
@each $class, $value in $fontsize {
&-#{$class},
&-#{math.div($value ,2)} {
font-size: calc(#{$value}rpx + var(--textSize)) !important;
}
}
&-cut {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
@at-root [class*='text-linecut'] {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
@for $i from 2 through 10 {
&-linecut-#{$i} {
-webkit-line-clamp: #{$i};
}
}
&-justify {
text-align: justify;
}
&-justify-line {
text-align: justify;
line-height: 0.5em;
margin-top: 0.5em;
&::after {
content: '.';
display: inline-block;
width: 100%;
}
}
&-Abc {
text-transform: Capitalize !important;
}
&-ABC {
text-transform: Uppercase !important;
}
&-abc {
text-transform: Lowercase !important;
}
&-del,
&-line {
text-decoration: line-through !important;
}
&-bottomline {
text-decoration: underline !important;
}
&-italic {
font-style: italic !important;
}
&-style-none {
text-decoration: none !important;
}
&-break {
word-break: break-word !important;
overflow-wrap: break-word !important;
}
&-reset {
color: inherit !important;
}
&-price::before {
content: '¥';
font-size: 80%;
margin-right: 4rpx;
}
&-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
}