@neatui/css 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/form/form@a/checkbox.scss +1 -1
- package/core/basic.scss +2 -12
- package/core/media-v2.scss +100 -0
- package/core/size.scss +6 -1
- package/neatui.scss +21 -20
- package/package.json +1 -1
- package/core/media copy.scss +0 -270
- package/core/neatui.core.scss.backup +0 -34
- package/core/theme-v2.scss +0 -378
package/core/basic.scss
CHANGED
|
@@ -468,24 +468,14 @@ code,
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
// 省略号
|
|
471
|
-
[ui-omit
|
|
472
|
-
[ui-omit~='2'],
|
|
473
|
-
[ui-omit~='3'],
|
|
474
|
-
[ui-omit~='4'],
|
|
475
|
-
[ui-omit~='5'],
|
|
476
|
-
[ui-omit~='6'],
|
|
477
|
-
[ui-omit~='7'],
|
|
478
|
-
[ui-omit~='8'],
|
|
479
|
-
[ui-omit~='9'] {
|
|
471
|
+
[ui-omit] {
|
|
480
472
|
display: -webkit-box;
|
|
481
473
|
overflow: hidden;
|
|
482
474
|
text-overflow: ellipsis;
|
|
483
475
|
-webkit-box-orient: vertical;
|
|
476
|
+
-webkit-text-size-adjust: 100%;
|
|
484
477
|
}
|
|
485
478
|
[ui-omit~='1'] {
|
|
486
|
-
// overflow: hidden;
|
|
487
|
-
// white-space: nowrap;
|
|
488
|
-
// text-overflow: ellipsis;
|
|
489
479
|
-webkit-line-clamp: 1;
|
|
490
480
|
}
|
|
491
481
|
[ui-omit~='2'] {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
$level: (
|
|
4
|
+
mob-s: 320,
|
|
5
|
+
mob-m: 480,
|
|
6
|
+
mob-l: 640,
|
|
7
|
+
pad-s: 800,
|
|
8
|
+
pad-m: 960,
|
|
9
|
+
pad-l: 1120,
|
|
10
|
+
dpc-s: 1280,
|
|
11
|
+
dpc-m: 1440,
|
|
12
|
+
dpc-l: 1600
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// 桌面
|
|
16
|
+
@mixin dpc() {
|
|
17
|
+
}
|
|
18
|
+
// 平板
|
|
19
|
+
@mixin pad() {
|
|
20
|
+
}
|
|
21
|
+
// 手机
|
|
22
|
+
@mixin mob() {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 通用
|
|
26
|
+
@mixin med($p) {
|
|
27
|
+
$this: #{list.nth(&, 1)};
|
|
28
|
+
$sign: string.slice($p, 1, 1);
|
|
29
|
+
$size: string.slice($p, 2, -1);
|
|
30
|
+
|
|
31
|
+
@each $key, $value in $level {
|
|
32
|
+
@if ($sign == '>') {
|
|
33
|
+
@media screen and (max-width: 799px) {
|
|
34
|
+
@if ($this == '') {
|
|
35
|
+
@content;
|
|
36
|
+
} @else {
|
|
37
|
+
& {
|
|
38
|
+
@content;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@if ($sign == '<') {
|
|
44
|
+
@media screen and (max-width: 799px) {
|
|
45
|
+
@if ($this == '') {
|
|
46
|
+
@content;
|
|
47
|
+
} @else {
|
|
48
|
+
& {
|
|
49
|
+
@content;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
@if ($sign == '=') {
|
|
55
|
+
@media screen and (max-width: 799px) {
|
|
56
|
+
@if ($this == '') {
|
|
57
|
+
@content;
|
|
58
|
+
} @else {
|
|
59
|
+
& {
|
|
60
|
+
@content;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@if ($p == '=mob') {
|
|
68
|
+
@media screen and (max-width: 799px) {
|
|
69
|
+
@if ($this == '') {
|
|
70
|
+
@content;
|
|
71
|
+
} @else {
|
|
72
|
+
& {
|
|
73
|
+
@content;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@if ($p == '=pad') {
|
|
79
|
+
@media screen and (min-width: 800px) and (max-width: 1119px) {
|
|
80
|
+
@if ($this == '') {
|
|
81
|
+
@content;
|
|
82
|
+
} @else {
|
|
83
|
+
& {
|
|
84
|
+
@content;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
@if ($p == '=dpc') {
|
|
90
|
+
@media screen and (min-width: 1120px) {
|
|
91
|
+
@if ($this == '') {
|
|
92
|
+
@content;
|
|
93
|
+
} @else {
|
|
94
|
+
& {
|
|
95
|
+
@content;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
package/core/size.scss
CHANGED
|
@@ -36,17 +36,22 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
$sz: 0.6;
|
|
39
|
+
$add: 0.05;
|
|
39
40
|
@each $k in $rank {
|
|
40
41
|
@if ($sz<1.2) {
|
|
41
42
|
$sz: $sz + 0.1;
|
|
42
43
|
} @else if ($sz<1.4) {
|
|
43
44
|
$sz: $sz + 0.2;
|
|
45
|
+
$add: 0.1;
|
|
44
46
|
} @else if($sz<2.4) {
|
|
45
47
|
$sz: $sz + 0.4;
|
|
48
|
+
$add: 0.2;
|
|
46
49
|
} @else if($sz<3.4) {
|
|
47
50
|
$sz: $sz + 0.6;
|
|
51
|
+
$add: 0.3;
|
|
48
52
|
} @else {
|
|
49
53
|
$sz: $sz + 0.8;
|
|
54
|
+
$add: 0.4;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
.#{$d}fs-#{$k},
|
|
@@ -64,7 +69,7 @@
|
|
|
64
69
|
.#{$d}fs-#{$k}\+\:end::after,
|
|
65
70
|
.#{$d}fs-#{$k}-sub\+\:sta > *::before,
|
|
66
71
|
.#{$d}fs-#{$k}-sub\+\:end > *::after {
|
|
67
|
-
font-size: #{$sz +
|
|
72
|
+
font-size: #{$sz + $add}rem;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
// 双倍
|
package/neatui.scss
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// 框架核心
|
|
4
4
|
// 重置
|
|
5
|
-
@forward './core/reset.scss';
|
|
5
|
+
// @forward './core/reset.scss';
|
|
6
6
|
// 主题
|
|
7
7
|
@forward './core/theme.scss';
|
|
8
8
|
// 响应
|
|
@@ -31,24 +31,25 @@
|
|
|
31
31
|
@forward './core/ux.scss';
|
|
32
32
|
|
|
33
33
|
// 组件
|
|
34
|
-
@forward './components/anim/index.scss';
|
|
34
|
+
// @forward './components/anim/index.scss';
|
|
35
35
|
@forward './components/btns/index.scss';
|
|
36
|
-
@forward './components/card/index.scss';
|
|
37
|
-
@forward './components/form/index.scss';
|
|
38
|
-
@forward './components/icon/index.scss';
|
|
39
|
-
@forward './components/imgs/index.scss';
|
|
40
|
-
@forward './components/line/index.scss';
|
|
41
|
-
@forward './components/list/index.scss';
|
|
42
|
-
@forward './components/load/index.scss';
|
|
43
|
-
@forward './components/menu/index.scss';
|
|
44
|
-
@forward './components/navs/index.scss';
|
|
45
|
-
@forward './components/note/index.scss';
|
|
46
|
-
@forward './components/opts/index.scss';
|
|
47
|
-
@forward './components/path/index.scss';
|
|
48
|
-
@forward './components/side/index.scss';
|
|
49
|
-
@forward './components/steps/index.scss';
|
|
50
|
-
@forward './components/table/index.scss';
|
|
51
|
-
@forward './components/tabs/index.scss';
|
|
52
|
-
@forward './components/tags/index.scss';
|
|
36
|
+
// @forward './components/card/index.scss';
|
|
37
|
+
// @forward './components/form/index.scss';
|
|
38
|
+
// @forward './components/icon/index.scss';
|
|
39
|
+
// @forward './components/imgs/index.scss';
|
|
40
|
+
// @forward './components/line/index.scss';
|
|
41
|
+
// @forward './components/list/index.scss';
|
|
42
|
+
// @forward './components/load/index.scss';
|
|
43
|
+
// @forward './components/menu/index.scss';
|
|
44
|
+
// @forward './components/navs/index.scss';
|
|
45
|
+
// @forward './components/note/index.scss';
|
|
46
|
+
// @forward './components/opts/index.scss';
|
|
47
|
+
// @forward './components/path/index.scss';
|
|
48
|
+
// @forward './components/side/index.scss';
|
|
49
|
+
// @forward './components/steps/index.scss';
|
|
50
|
+
// @forward './components/table/index.scss';
|
|
51
|
+
// @forward './components/tabs/index.scss';
|
|
52
|
+
// @forward './components/tags/index.scss';
|
|
53
53
|
@forward './components/tips/index.scss';
|
|
54
|
-
@forward './components/title/index.scss';
|
|
54
|
+
// @forward './components/title/index.scss';
|
|
55
|
+
|
package/package.json
CHANGED
package/core/media copy.scss
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:string';
|
|
3
|
-
$level: (
|
|
4
|
-
mob-s: 320px,
|
|
5
|
-
mob-m: 480px,
|
|
6
|
-
mob-l: 640px,
|
|
7
|
-
pad-s: 800px,
|
|
8
|
-
pad-m: 960px,
|
|
9
|
-
pad-l: 1120px,
|
|
10
|
-
dpc-s: 1280px,
|
|
11
|
-
dpc-m: 1440px,
|
|
12
|
-
dpc-l: 1600px
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
// 桌面
|
|
16
|
-
@mixin dpc() {
|
|
17
|
-
$this: #{list.nth(&, 1)};
|
|
18
|
-
@media screen and (min-width: 1120px) {
|
|
19
|
-
@if ($this == '') {
|
|
20
|
-
@content;
|
|
21
|
-
} @else {
|
|
22
|
-
& {
|
|
23
|
-
@content;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 平板
|
|
30
|
-
@mixin pad() {
|
|
31
|
-
$this: #{list.nth(&, 1)};
|
|
32
|
-
@media screen and (max-width: 1119px) {
|
|
33
|
-
@if ($this == '') {
|
|
34
|
-
@content;
|
|
35
|
-
} @else {
|
|
36
|
-
& {
|
|
37
|
-
@content;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 移动
|
|
44
|
-
@mixin mob() {
|
|
45
|
-
$this: #{list.nth(&, 1)};
|
|
46
|
-
@media screen and (max-width: 799px) {
|
|
47
|
-
@if ($this == '') {
|
|
48
|
-
@content;
|
|
49
|
-
} @else {
|
|
50
|
-
& {
|
|
51
|
-
@content;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// 设备
|
|
58
|
-
@mixin med($p) {
|
|
59
|
-
$this: #{list.nth(&, 1)};
|
|
60
|
-
|
|
61
|
-
$r: string.slice($p, 1, 1);
|
|
62
|
-
$_n: string.slice($p, 2, -1);
|
|
63
|
-
|
|
64
|
-
// 大于某节点时
|
|
65
|
-
@if ($r == '>') {
|
|
66
|
-
// 大于平板
|
|
67
|
-
@if ($p == '>pad') {
|
|
68
|
-
@media screen and (min-width: 1120px) {
|
|
69
|
-
@if ($this == '') {
|
|
70
|
-
@content;
|
|
71
|
-
} @else {
|
|
72
|
-
& {
|
|
73
|
-
@content;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// 大于移动
|
|
79
|
-
@if ($p == '>mob') {
|
|
80
|
-
@media screen and (min-width: 800px) {
|
|
81
|
-
@if ($this == '') {
|
|
82
|
-
@content;
|
|
83
|
-
} @else {
|
|
84
|
-
& {
|
|
85
|
-
@content;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
@each $sz in $level {
|
|
91
|
-
$n: #{list.nth($sz, 1)};
|
|
92
|
-
$v: #{list.nth($sz, 2)};
|
|
93
|
-
@if ($_n == $n) {
|
|
94
|
-
@media screen and (min-width: $v) {
|
|
95
|
-
@if ($this == '') {
|
|
96
|
-
@content;
|
|
97
|
-
} @else {
|
|
98
|
-
& {
|
|
99
|
-
@content;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// 小于某节点时
|
|
107
|
-
@if ($r == '<') {
|
|
108
|
-
// 小于桌面
|
|
109
|
-
@if ($p == '<dpc') {
|
|
110
|
-
@media screen and (max-width: 1119px) {
|
|
111
|
-
@if ($this == '') {
|
|
112
|
-
@content;
|
|
113
|
-
} @else {
|
|
114
|
-
& {
|
|
115
|
-
@content;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// 小于平板
|
|
121
|
-
@if ($p == '<pad') {
|
|
122
|
-
@media screen and (max-width: 799px) {
|
|
123
|
-
@if ($this == '') {
|
|
124
|
-
@content;
|
|
125
|
-
} @else {
|
|
126
|
-
& {
|
|
127
|
-
@content;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
@each $sz in $level {
|
|
134
|
-
$n: #{list.nth($sz, 1)};
|
|
135
|
-
$v: #{list.nth($sz, 2) - 1};
|
|
136
|
-
@if ($_n == $n) {
|
|
137
|
-
@media screen and (max-width: $v) {
|
|
138
|
-
@if ($this == '') {
|
|
139
|
-
@content;
|
|
140
|
-
} @else {
|
|
141
|
-
& {
|
|
142
|
-
@content;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
// 仅在某节点时
|
|
150
|
-
@if ($r == '=') {
|
|
151
|
-
@if ($p == '=dpc') {
|
|
152
|
-
@media screen and (min-width: 1120px) {
|
|
153
|
-
@if ($this == '') {
|
|
154
|
-
@content;
|
|
155
|
-
} @else {
|
|
156
|
-
& {
|
|
157
|
-
@content;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
@if ($p == '=pad') {
|
|
163
|
-
@media screen and (min-width: 800px) and (max-width: 1119px) {
|
|
164
|
-
@if ($this == '') {
|
|
165
|
-
@content;
|
|
166
|
-
} @else {
|
|
167
|
-
& {
|
|
168
|
-
@content;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
@if ($p == '=mob') {
|
|
174
|
-
@media screen and (max-width: 799px) {
|
|
175
|
-
@if ($this == '') {
|
|
176
|
-
@content;
|
|
177
|
-
} @else {
|
|
178
|
-
& {
|
|
179
|
-
@content;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
@each $sz in $level {
|
|
185
|
-
$n: #{list.nth($sz, 1)};
|
|
186
|
-
$v: #{list.nth($sz, 2)};
|
|
187
|
-
$m: #{list.nth($sz, 2) + 159};
|
|
188
|
-
@if ($_n == $n) {
|
|
189
|
-
@if ($_n == 'mob-s') {
|
|
190
|
-
@media screen and (max-width: $m) {
|
|
191
|
-
@content;
|
|
192
|
-
}
|
|
193
|
-
} @else if($_n == 'dpc-l') {
|
|
194
|
-
@media screen and (min-width: $v) {
|
|
195
|
-
@content;
|
|
196
|
-
}
|
|
197
|
-
} @else {
|
|
198
|
-
@media screen and (min-width: $v) and (max-width: $m) {
|
|
199
|
-
@content;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// 大于某节点时
|
|
208
|
-
@each $sz in $level {
|
|
209
|
-
$n: #{list.nth($sz, 1)};
|
|
210
|
-
[ui-hide~='>#{$n}'] {
|
|
211
|
-
@include med('>#{$n}') {
|
|
212
|
-
display: none !important;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
[ui-hide~='>mob'] {
|
|
217
|
-
@include med('>mob') {
|
|
218
|
-
display: none !important;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
[ui-hide~='>pad'] {
|
|
222
|
-
@include med('>pad') {
|
|
223
|
-
display: none !important;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// 小于某节点时
|
|
228
|
-
@each $sz in $level {
|
|
229
|
-
$n: #{list.nth($sz, 1)};
|
|
230
|
-
[ui-hide~='<#{$n}'] {
|
|
231
|
-
@include med('<#{$n}') {
|
|
232
|
-
display: none !important;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
[ui-hide~='<pad'] {
|
|
237
|
-
@include med('<pad') {
|
|
238
|
-
display: none !important;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
[ui-hide~='<dpc'] {
|
|
242
|
-
@include med('<dpc') {
|
|
243
|
-
display: none !important;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// 等于某节点时
|
|
248
|
-
@each $sz in $level {
|
|
249
|
-
$n: #{list.nth($sz, 1)};
|
|
250
|
-
[ui-hide~='=#{$n}'] {
|
|
251
|
-
@include med('=#{$n}') {
|
|
252
|
-
display: none !important;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
[ui-hide~='=mob'] {
|
|
257
|
-
@include med('=mob') {
|
|
258
|
-
display: none !important;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
[ui-hide~='=pad'] {
|
|
262
|
-
@include med('=pad') {
|
|
263
|
-
display: none !important;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
[ui-hide~='=dpc'] {
|
|
267
|
-
@include med('=dpc') {
|
|
268
|
-
display: none !important;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// neatui.core.scss
|
|
2
|
-
|
|
3
|
-
@charset "utf-8";
|
|
4
|
-
@use 'sass:math';
|
|
5
|
-
// 主题
|
|
6
|
-
@forward './theme-v3.scss';
|
|
7
|
-
// 色号
|
|
8
|
-
// @use './color.scss';
|
|
9
|
-
// 响应
|
|
10
|
-
// @forward './media.scss';
|
|
11
|
-
// 重置
|
|
12
|
-
// @forward './reset.scss';
|
|
13
|
-
// 基础
|
|
14
|
-
// @forward './base.scss';
|
|
15
|
-
// // 字号
|
|
16
|
-
// @forward './size.scss';
|
|
17
|
-
// // 栅格
|
|
18
|
-
// @forward './cols.scss';
|
|
19
|
-
// // 格子(新)
|
|
20
|
-
// @forward './grid.scss';
|
|
21
|
-
// // 微调
|
|
22
|
-
// @forward './trim.scss';
|
|
23
|
-
// // 边框
|
|
24
|
-
// @forward './border.scss';
|
|
25
|
-
// // 布局
|
|
26
|
-
// @forward './flex.scss';
|
|
27
|
-
// // 缩小
|
|
28
|
-
// @forward './scale.scss';
|
|
29
|
-
// // 滚动条
|
|
30
|
-
// @forward './scroll.scss';
|
|
31
|
-
// // 封面
|
|
32
|
-
// @forward './cover.scss';
|
|
33
|
-
// // 交互
|
|
34
|
-
// @forward './ux.scss';
|
package/core/theme-v2.scss
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:meta';
|
|
3
|
-
@use 'sass:map';
|
|
4
|
-
@use 'sass:color';
|
|
5
|
-
@use 'sass:string';
|
|
6
|
-
|
|
7
|
-
// 兜底
|
|
8
|
-
$theme: if(
|
|
9
|
-
meta.global-variable-exists(theme),
|
|
10
|
-
$theme,
|
|
11
|
-
(
|
|
12
|
-
_sys: (
|
|
13
|
-
main: #0889e4,
|
|
14
|
-
text: #000000,
|
|
15
|
-
fore: #ffffff,
|
|
16
|
-
back: #f5f5f5,
|
|
17
|
-
link: #d07950,
|
|
18
|
-
code: #e23861,
|
|
19
|
-
well: #4bbc73,
|
|
20
|
-
warn: #fb9a2a,
|
|
21
|
-
risk: #f95850,
|
|
22
|
-
info: #0889e4
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
) !default;
|
|
26
|
-
|
|
27
|
-
// 检测
|
|
28
|
-
@if (meta.global-variable-exists(theme)) {
|
|
29
|
-
$fa: map.keys($theme);
|
|
30
|
-
$fk: list.nth($fa, 1);
|
|
31
|
-
@if (list.length($fa) == 1 and $fk == _sys) {
|
|
32
|
-
@warn '检测到您未定义主题色卡,请遵循 neatui 设计规范建立主题色卡;https://neatui.fekit.cn/#/docs/config';
|
|
33
|
-
@debug '尝试修复错误...';
|
|
34
|
-
@debug '创建系统默认色卡[theme=_sys]';
|
|
35
|
-
} @else {
|
|
36
|
-
@debug '检测到主题色卡[theme=#{$fk}]';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@each $var in $theme {
|
|
40
|
-
$n: list.nth($var, 1);
|
|
41
|
-
$s: list.nth($var, 2);
|
|
42
|
-
@if ($s and meta.type-of($s) == 'map') {
|
|
43
|
-
$baseColor: 'main', 'text', 'fore', 'back', 'link', 'code', 'well', 'warn', 'risk';
|
|
44
|
-
@each $baseColorItem in $baseColor {
|
|
45
|
-
@if (map.has-key($s, $baseColorItem)) {
|
|
46
|
-
} @else {
|
|
47
|
-
@warn '[theme=#{$n}]主题缺少一个关键的基础颜色#{$baseColorItem}';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} @else {
|
|
51
|
-
@debug '[theme=#{$n}]主题色卡配置错误';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 扩展颜色
|
|
57
|
-
@each $i in $theme {
|
|
58
|
-
$n: list.nth($i, 1);
|
|
59
|
-
$s: list.nth($i, 2);
|
|
60
|
-
@if ($s and meta.type-of($s) == 'map') {
|
|
61
|
-
$m: (
|
|
62
|
-
none: transparent,
|
|
63
|
-
w: #ffffff,
|
|
64
|
-
b: #000000,
|
|
65
|
-
read: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 85%),
|
|
66
|
-
desc: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 55%),
|
|
67
|
-
note: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 35%),
|
|
68
|
-
case: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 20%),
|
|
69
|
-
line: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 10%),
|
|
70
|
-
weak: color.mix(map.get($s, 'text'), map.get($s, 'fore'), 4%)
|
|
71
|
-
);
|
|
72
|
-
// 将扩展颜色加入放题色卡中
|
|
73
|
-
$theme: map.merge(
|
|
74
|
-
$theme,
|
|
75
|
-
(
|
|
76
|
-
$n: map.merge($m, $s)
|
|
77
|
-
)
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// 主题
|
|
83
|
-
// @mixin theme($n: null) {
|
|
84
|
-
// $hasTheme: map.get($theme, $n);
|
|
85
|
-
// @if ($n != null) {
|
|
86
|
-
// @if ($hasTheme != null) {
|
|
87
|
-
// $t: $hasTheme;
|
|
88
|
-
// $first: list.nth(list.nth($theme, 1), 1);
|
|
89
|
-
// $n: $n;
|
|
90
|
-
// $s: #{list.nth(&, 1)};
|
|
91
|
-
// @if ($s == 'html' or $s == '' or $s == null) {
|
|
92
|
-
// @if ($n == $first) {
|
|
93
|
-
// @at-root html {
|
|
94
|
-
// @content;
|
|
95
|
-
// }
|
|
96
|
-
// } @else {
|
|
97
|
-
// @at-root [theme='#{$n}'] {
|
|
98
|
-
// @content;
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
// } @else {
|
|
102
|
-
// @if ($n == $first) {
|
|
103
|
-
// @content;
|
|
104
|
-
// } @else {
|
|
105
|
-
// [theme='#{$n}'] & {
|
|
106
|
-
// @content;
|
|
107
|
-
// }
|
|
108
|
-
// }
|
|
109
|
-
// }
|
|
110
|
-
// } @else {
|
|
111
|
-
// @warn '没有指定主题#{$hasTheme}';
|
|
112
|
-
// }
|
|
113
|
-
// } @else {
|
|
114
|
-
// $first: list.nth(list.nth($theme, 1), 1);
|
|
115
|
-
// @each $t in $theme {
|
|
116
|
-
// $n: list.nth($t, 1);
|
|
117
|
-
// $s: #{list.nth(&, 1)};
|
|
118
|
-
|
|
119
|
-
// @if ($s == 'html' or $s == ':root' or $s == '' or $s == null) {
|
|
120
|
-
// @if ($n == $first) {
|
|
121
|
-
// @at-root html {
|
|
122
|
-
// @content;
|
|
123
|
-
// }
|
|
124
|
-
// } @else {
|
|
125
|
-
// @at-root [theme='#{$n}'] {
|
|
126
|
-
// @content;
|
|
127
|
-
// }
|
|
128
|
-
// }
|
|
129
|
-
// } @else {
|
|
130
|
-
// @if ($n == $first) {
|
|
131
|
-
// @content;
|
|
132
|
-
// } @else {
|
|
133
|
-
// [theme='#{$n}'] & {
|
|
134
|
-
// @content;
|
|
135
|
-
// }
|
|
136
|
-
// }
|
|
137
|
-
// }
|
|
138
|
-
// }
|
|
139
|
-
// }
|
|
140
|
-
// }
|
|
141
|
-
|
|
142
|
-
// 颜色
|
|
143
|
-
// @function co($a: '') {
|
|
144
|
-
// @if (& != null) {
|
|
145
|
-
// $r: list.nth(list.nth(&, 1), 1);
|
|
146
|
-
// $n: string.slice($r, 8, -2);
|
|
147
|
-
// $s: map.get($theme, $n);
|
|
148
|
-
// @if ($s == null) {
|
|
149
|
-
// $n: list.nth(list.nth($theme, 1), 1);
|
|
150
|
-
// $s: list.nth(list.nth($theme, 1), 2);
|
|
151
|
-
// }
|
|
152
|
-
// @if ($s != null) {
|
|
153
|
-
// @if (map.has-key($s, $a)) {
|
|
154
|
-
// $a: map.get($s, $a);
|
|
155
|
-
// } @else {
|
|
156
|
-
// @debug '当前主题[theme=#{$n}]没有定义颜色名 #{$a}';
|
|
157
|
-
// }
|
|
158
|
-
// }
|
|
159
|
-
// @return $a;
|
|
160
|
-
// } @else {
|
|
161
|
-
// @return transparent;
|
|
162
|
-
// }
|
|
163
|
-
// }
|
|
164
|
-
|
|
165
|
-
// 变量
|
|
166
|
-
@mixin vars() {
|
|
167
|
-
$levels: xs, ss, sm, sl, ms, mm, ml, ls, lm, ll, xl;
|
|
168
|
-
$colors: main, text, well, warn, risk;
|
|
169
|
-
|
|
170
|
-
$f: list.nth(list.nth($theme, 1), 1);
|
|
171
|
-
@each $i in $theme {
|
|
172
|
-
$n: list.nth($i, 1);
|
|
173
|
-
$s: list.nth($i, 2);
|
|
174
|
-
@if ($n == $f) {
|
|
175
|
-
:root,
|
|
176
|
-
[theme~='#{$n}'] {
|
|
177
|
-
@each $c in $s {
|
|
178
|
-
$k: list.nth($c, 1);
|
|
179
|
-
$v: list.nth($c, 2);
|
|
180
|
-
--co-#{$k}: #{$v};
|
|
181
|
-
|
|
182
|
-
$ls: 0.05;
|
|
183
|
-
@each $l in $levels {
|
|
184
|
-
// 透明度
|
|
185
|
-
@if ($k != 'none') {
|
|
186
|
-
--co-#{$k}-#{$l}: #{rgba($v, $ls)};
|
|
187
|
-
@if ($k != 'w' and $k != 'b') {
|
|
188
|
-
--co-#{$k}-fore-#{$l}: #{color.mix($v, map.get($s, 'fore'), $ls * 100%)};
|
|
189
|
-
}
|
|
190
|
-
@if ($k == 'main' or $k == 'well' or $k == 'warn' or $k == 'risk') {
|
|
191
|
-
--co-#{$k}-text-#{$l}: #{color.mix($v, map.get($s, 'text'), $ls * 100%)};
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
@if ($ls <= 0.1 or $ls >= 0.8) {
|
|
195
|
-
$ls: $ls + 0.05;
|
|
196
|
-
} @else {
|
|
197
|
-
$ls: $ls + 0.1;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
} @else {
|
|
203
|
-
[theme~='#{$n}'] {
|
|
204
|
-
@each $c in $s {
|
|
205
|
-
$k: list.nth($c, 1);
|
|
206
|
-
$v: list.nth($c, 2);
|
|
207
|
-
--co-#{$k}: #{$v};
|
|
208
|
-
|
|
209
|
-
$ls: 0.05;
|
|
210
|
-
@each $l in $levels {
|
|
211
|
-
// 透明度
|
|
212
|
-
@if ($k != 'none') {
|
|
213
|
-
--co-#{$k}-#{$l}: #{rgba($v, $ls)};
|
|
214
|
-
|
|
215
|
-
@if ($k != 'w' and $k != 'b') {
|
|
216
|
-
--co-#{$k}-fore-#{$l}: #{color.mix($v, map.get($s, 'fore'), $ls * 100%)};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
@if ($k == 'main' or $k == 'well' or $k == 'warn' or $k == 'risk') {
|
|
220
|
-
--co-#{$k}-text-#{$l}: #{color.mix($v, map.get($s, 'text'), $ls * 100%)};
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
@if ($ls <= 0.1 or $ls >= 0.8) {
|
|
224
|
-
$ls: $ls + 0.05;
|
|
225
|
-
} @else {
|
|
226
|
-
$ls: $ls + 0.1;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
@include vars();
|
|
236
|
-
|
|
237
|
-
@mixin color() {
|
|
238
|
-
html,
|
|
239
|
-
[theme] {
|
|
240
|
-
color: var(--co-read);
|
|
241
|
-
fill: var(--co-read);
|
|
242
|
-
background-color: var(--co-back);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// 自动颜色
|
|
246
|
-
.co-auto,
|
|
247
|
-
.co-auto\:hover:hover,
|
|
248
|
-
.co-auto\:active:active {
|
|
249
|
-
color: currentColor !important;
|
|
250
|
-
fill: currentColor !important;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.bg-auto,
|
|
254
|
-
.bg-auto\:hover:hover,
|
|
255
|
-
.bg-auto\:active:active {
|
|
256
|
-
background-color: currentColor !important;
|
|
257
|
-
}
|
|
258
|
-
.bk-auto,
|
|
259
|
-
.bk-auto\:hover:hover,
|
|
260
|
-
.bk-auto\:active:active {
|
|
261
|
-
border-color: currentColor !important;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// 随机颜色
|
|
265
|
-
.bg-0 {
|
|
266
|
-
background-color: var(--co-main);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.bg-1 {
|
|
270
|
-
background-color: #0084ff;
|
|
271
|
-
}
|
|
272
|
-
.bg-2 {
|
|
273
|
-
background-color: #30d158;
|
|
274
|
-
}
|
|
275
|
-
.bg-3 {
|
|
276
|
-
background-color: #5e5ce6;
|
|
277
|
-
}
|
|
278
|
-
.bg-4 {
|
|
279
|
-
background-color: #ff9f0a;
|
|
280
|
-
}
|
|
281
|
-
.bg-5 {
|
|
282
|
-
background-color: #ff375f;
|
|
283
|
-
}
|
|
284
|
-
.bg-6 {
|
|
285
|
-
background-color: #af52de;
|
|
286
|
-
}
|
|
287
|
-
.bg-7 {
|
|
288
|
-
background-color: #ff453a;
|
|
289
|
-
}
|
|
290
|
-
.bg-8 {
|
|
291
|
-
background-color: #af52de;
|
|
292
|
-
}
|
|
293
|
-
.bg-9 {
|
|
294
|
-
background-color: #5ac8fa;
|
|
295
|
-
}
|
|
296
|
-
.bg-10 {
|
|
297
|
-
background-color: #ffcc00;
|
|
298
|
-
}
|
|
299
|
-
.bg-11 {
|
|
300
|
-
background-color: #8e8e93;
|
|
301
|
-
}
|
|
302
|
-
.bg-12 {
|
|
303
|
-
background-color: #bad80a;
|
|
304
|
-
}
|
|
305
|
-
.bg-13 {
|
|
306
|
-
background-color: #1d6fa3;
|
|
307
|
-
}
|
|
308
|
-
.bg-14 {
|
|
309
|
-
background-color: #fd6585;
|
|
310
|
-
}
|
|
311
|
-
.bg-15 {
|
|
312
|
-
background-color: #df5900;
|
|
313
|
-
}
|
|
314
|
-
.bg-16 {
|
|
315
|
-
background-color: #3388ff;
|
|
316
|
-
}
|
|
317
|
-
.bg-17 {
|
|
318
|
-
background-color: #623aa2;
|
|
319
|
-
}
|
|
320
|
-
.bg-18 {
|
|
321
|
-
background-color: #d939cd;
|
|
322
|
-
}
|
|
323
|
-
.bg-19 {
|
|
324
|
-
background-color: #f55555;
|
|
325
|
-
}
|
|
326
|
-
.bg-20 {
|
|
327
|
-
background-color: #bb4e75;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
$f: list.nth(list.nth($theme, 1), 1);
|
|
331
|
-
@each $i in $theme {
|
|
332
|
-
$s: list.nth($i, 2);
|
|
333
|
-
@each $c in $s {
|
|
334
|
-
$n: list.nth($c, 1);
|
|
335
|
-
$v: list.nth($c, 2);
|
|
336
|
-
// @include color(list.nth($c, 1), list.nth($c, 2));
|
|
337
|
-
$levels: xs, ss, sm, sl, ms, mm, ml, ls, lm, ll, xl;
|
|
338
|
-
|
|
339
|
-
.co-#{$n},
|
|
340
|
-
.co-#{$n}\:hover:hover,
|
|
341
|
-
.co-#{$n}\:active:active {
|
|
342
|
-
color: var(--co-#{$n}) !important;
|
|
343
|
-
fill: var(--co-#{$n}) !important;
|
|
344
|
-
}
|
|
345
|
-
.bg-#{$n},
|
|
346
|
-
.bg-#{$n}\:hover:hover,
|
|
347
|
-
.bg-#{$n}\:active:active {
|
|
348
|
-
background-color: var(--co-#{$n}) !important;
|
|
349
|
-
}
|
|
350
|
-
.bk-#{$n},
|
|
351
|
-
.bk-#{$n}\:hover:hover,
|
|
352
|
-
.bk-#{$n}\:active:active {
|
|
353
|
-
border-color: var(--co-#{$n}) !important;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@each $i in $levels {
|
|
357
|
-
.co-#{$n}-#{$i},
|
|
358
|
-
.co-#{$n}-#{$i}\:hover:hover,
|
|
359
|
-
.co-#{$n}-#{$i}\:active:active {
|
|
360
|
-
color: var(--co-#{$n}-#{$i}) !important;
|
|
361
|
-
fill: var(--co-#{$n}-#{$i}) !important;
|
|
362
|
-
}
|
|
363
|
-
.bg-#{$n}-#{$i},
|
|
364
|
-
.bg-#{$n}-#{$i}\:hover:hover,
|
|
365
|
-
.bg-#{$n}-#{$i}\:active:active {
|
|
366
|
-
background-color: var(--co-#{$n}-#{$i}) !important;
|
|
367
|
-
}
|
|
368
|
-
.bk-#{$n}-#{$i},
|
|
369
|
-
.bk-#{$n}-#{$i}\:hover:hover,
|
|
370
|
-
.bk-#{$n}-#{$i}\:active:active {
|
|
371
|
-
border-color: var(--co-#{$n}-#{$i}) !important;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
@include color();
|