index.scss
2.52 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.zui-button {
color: #323233;
background-color: #fff;
padding: $h-gap-md $v-gap-md;
font-size: $font-md;
cursor: pointer;
transition: all 150ms;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10upx;
position: relative;
&::after {
padding: 0;
margin: 0;
border: none;
content: "";
pointer-events: none; /* 防止点击触发 */
box-sizing: border-box;
position: absolute;
width: 200%;
height: 200%;
left: 0;
top: 0;
border: 1upx solid $color-border;
border-radius: 20upx;
transform: scale(0.5);
transform-origin: 0 0;
}
&.sm {
padding: $h-gap-sm $v-gap-sm;
font-size: $font-sm;
}
&.lg {
padding: $h-gap-lg $v-gap-lg;
font-size: $font-lg;
}
&.active {
background-color: $bg-active;
&, &::after {
border-color: $bg-active;
}
}
&.primary {
background-color: $color-primary;
color: #FFF;
&.active {
background-color: darken($color-primary, 3%);
&, &::after {
border-color: darken($color-primary, 3%);
}
}
&, &::after {
border-color: $color-primary;
}
}
&.secondary {
background-color: lighten($color-primary, 40%);
color: $color-primary;
&.active {
background-color: lighten($color-primary, 30%);
color: darken($color-primary, 3%);
&, &::after {
border-color: lighten($color-primary, 30%);
}
}
&, &::after {
border-color: lighten($color-primary, 40%);
}
}
&.plain {
&.primary {
color: $color-primary;
background-color: transparent;
&.active {
background-color: rgba($color-primary, 0.1);
}
}
&.disabled {
background-color: rgba($bg-disabled, 0.1);
color: $color-disabled;
cursor: not-allowed;
&.active {
color: $color-disabled;
background-color: rgba($bg-disabled, 0.1);
&, &::after {
border-color: $bg-disabled;
}
}
&, &::after {
border-color: $bg-disabled;
}
}
}
&.link {
padding: $h-gap-sm $v-gap-sm;
background: inherit;
border: inherit;
color: $color-primary;
&.active {
color: darken($color-primary, 5%);
}
&::after {
display: none;
}
}
&.disabled {
background-color: $bg-disabled;
color: $color-disabled;
cursor: not-allowed;
&.active {
background-color: $bg-disabled;
&, &::after {
border-color: $bg-disabled;
}
}
&, &::after {
border-color: $bg-disabled;
}
}
&.round {
border-radius: 48upx;
&::after {
border-radius: 96upx;
}
}
&.square {
border-radius: 0upx;
&::after {
border-radius: 0;
}
}
}