@neatui/css 4.8.2 → 5.0.0

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.
@@ -0,0 +1,75 @@
1
+ $avatar-a-co: 'main', 'well', 'warn', 'risk', 'info';
2
+ $avatar-a-sz: (
3
+ 'xs': 1.5em,
4
+ 's': 2em,
5
+ 'm': 2.5em,
6
+ 'l': 3em,
7
+ 'xl': 4em,
8
+ );
9
+
10
+ // 单个
11
+ [ui-avatar~='@a'] {
12
+ --avatar-size: 2.5em;
13
+
14
+ position: relative;
15
+ display: inline-flex;
16
+ flex-shrink: 0;
17
+ align-items: center;
18
+ justify-content: center;
19
+ width: var(--avatar-size);
20
+ height: var(--avatar-size);
21
+ border-radius: 50%;
22
+ overflow: hidden;
23
+ vertical-align: middle;
24
+ font-size: 1em;
25
+ font-weight: bold;
26
+ line-height: 1;
27
+ white-space: nowrap;
28
+ user-select: none;
29
+
30
+ color: var(--co-desc);
31
+ background: var(--co-line);
32
+
33
+ & > img {
34
+ display: block;
35
+ width: 100%;
36
+ height: 100%;
37
+ object-fit: cover;
38
+ }
39
+
40
+ // 文字随头像尺寸缩放
41
+ & > span {
42
+ font-size: calc(var(--avatar-size) * 0.4);
43
+ }
44
+
45
+ // 方形
46
+ &[ui-avatar~=':square'] {
47
+ border-radius: 0.25em;
48
+ }
49
+
50
+ @each $sz, $v in $avatar-a-sz {
51
+ &[ui-avatar~='#{$sz}'] {
52
+ --avatar-size: #{$v};
53
+ }
54
+ }
55
+
56
+ @each $co in $avatar-a-co {
57
+ &[ui-avatar~='#{$co}'] {
58
+ color: #fff;
59
+ background: var(--co-#{$co});
60
+ }
61
+ }
62
+ }
63
+
64
+ // 群组:叠加展示
65
+ [ui-avatars~='@a'] {
66
+ display: inline-flex;
67
+ align-items: center;
68
+
69
+ & > * + * {
70
+ margin-left: -0.5em;
71
+ }
72
+ & > * {
73
+ box-shadow: 0 0 0 2px var(--co-fore);
74
+ }
75
+ }
@@ -0,0 +1 @@
1
+ @forward './avatar@a.scss';
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@neatui/avatar",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.scss",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://gitlab.com/neatui/neatui.git"
12
+ },
13
+ "keywords": [
14
+ "neatui"
15
+ ],
16
+ "author": "xiaojunbo",
17
+ "license": "MIT",
18
+ "bugs": {
19
+ "url": "https://gitlab.com/neatui/neatui/issues"
20
+ },
21
+ "homepage": "https://gitlab.com/neatui/neatui#readme"
22
+ }
@@ -1,2 +1,3 @@
1
1
  @forward './tags@a.scss';
2
2
  @forward './tags@b.scss';
3
+ @forward './tags@c.scss';
@@ -29,13 +29,13 @@ $tag-a-sz: 'xs', 's', 'm', 'l', 'xl';
29
29
  @if ($co== 'main') {
30
30
  &,
31
31
  &[ui-tag~='#{$co}'] {
32
- color: var(--co-#{$co});
32
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
33
33
  box-shadow: inset 0 0 0 1px var(--co-#{$co}-o-ms);
34
34
  background: var(--co-#{$co}-o-sm);
35
35
  }
36
36
  } @else {
37
37
  &[ui-tag~='#{$co}'] {
38
- color: var(--co-#{$co});
38
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
39
39
  box-shadow: inset 0 0 0 1px var(--co-#{$co}-o-ms);
40
40
  background: var(--co-#{$co}-o-sm);
41
41
  }
@@ -86,7 +86,7 @@ $tag-a-sz: 'xs', 's', 'm', 'l', 'xl';
86
86
  border-radius: 10em 0;
87
87
  }
88
88
  // 弹头
89
- &[ui-tag~=':bullet'] > * {
89
+ &[ui-tags~=':bullet'] > * {
90
90
  padding: 0.25em 0.65em 0.25em 0.5em;
91
91
  border-radius: 1em 0.2em 0.2em 1em;
92
92
  }
@@ -96,13 +96,13 @@ $tag-a-sz: 'xs', 's', 'm', 'l', 'xl';
96
96
  @if ($co== 'main') {
97
97
  & > *,
98
98
  &[ui-tags~='#{$co}'] > * {
99
- color: var(--co-#{$co});
99
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
100
100
  box-shadow: inset 0 0 0 1px var(--co-#{$co}-o-ms);
101
101
  background: var(--co-#{$co}-o-sm);
102
102
  }
103
103
  } @else {
104
104
  &[ui-tags~='#{$co}'] > * {
105
- color: var(--co-#{$co});
105
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
106
106
  box-shadow: inset 0 0 0 1px var(--co-#{$co}-o-ms);
107
107
  background: var(--co-#{$co}-o-sm);
108
108
  }
@@ -39,12 +39,12 @@ $tag-b-sz: 'xs', 's', 'm', 'l', 'xl';
39
39
  @if ($co== 'main') {
40
40
  &,
41
41
  &[ui-tag~='#{$co}'] {
42
- color: var(--co-#{$co});
42
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
43
43
  background: var(--co-#{$co}-o-sm);
44
44
  }
45
45
  } @else {
46
46
  &[ui-tag~='#{$co}'] {
47
- color: var(--co-#{$co});
47
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
48
48
  background: var(--co-#{$co}-o-sm);
49
49
  }
50
50
  }
@@ -94,7 +94,7 @@ $tag-b-sz: 'xs', 's', 'm', 'l', 'xl';
94
94
  border-radius: 10em 0;
95
95
  }
96
96
  // 弹头
97
- &[ui-tag~=':bullet'] > * {
97
+ &[ui-tags~=':bullet'] > * {
98
98
  padding: 0.5em 0.65em 0.5em 0.5em;
99
99
  border-radius: 1em 0.2em 0.2em 1em;
100
100
  }
@@ -104,12 +104,12 @@ $tag-b-sz: 'xs', 's', 'm', 'l', 'xl';
104
104
  @if ($co== 'main') {
105
105
  & > *,
106
106
  &[ui-tags~='#{$co}'] > * {
107
- color: var(--co-#{$co});
107
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
108
108
  background: var(--co-#{$co}-o-sm);
109
109
  }
110
110
  } @else {
111
111
  &[ui-tags~='#{$co}'] > * {
112
- color: var(--co-#{$co});
112
+ color: var(--co-#{$co}-b-lm, var(--co-#{$co}));
113
113
  background: var(--co-#{$co}-o-sm);
114
114
  }
115
115
  }
@@ -0,0 +1,135 @@
1
+ $tag-c-co: 'main', 'well', 'warn', 'risk', 'info', 'read', 'note', 'idle';
2
+
3
+ // 单个(实心徽标,如版本号)
4
+ [ui-tag~='@c'] {
5
+ display: inline-block;
6
+ padding: 2px 0.5em;
7
+ border-radius: 10em;
8
+ font-weight: bold;
9
+ line-height: 1.25;
10
+ white-space: nowrap;
11
+ vertical-align: middle;
12
+ color: #fff;
13
+
14
+ // 圆角
15
+ &[ui-tag~=':round'] {
16
+ border-radius: 10em;
17
+ }
18
+ // 方角
19
+ &[ui-tag~=':square'] {
20
+ border-radius: 0.2rem;
21
+ }
22
+ // 叶型
23
+ &[ui-tag~=':leaf'] {
24
+ border-radius: 0.5em 0;
25
+ }
26
+ // 弹头
27
+ &[ui-tag~=':bullet'] {
28
+ border-radius: 1em 0.2em 0.2em 1em;
29
+ }
30
+
31
+ // 尺寸(只调内边距,字号由 class 控制)
32
+ &[ui-tag~='s'] {
33
+ padding: 1px 0.5em;
34
+ }
35
+ &[ui-tag~='m'] {
36
+ padding: 2px 0.5em;
37
+ }
38
+ &[ui-tag~='l'] {
39
+ padding: 3px 0.5em;
40
+ }
41
+
42
+ // 颜色
43
+ @each $co in $tag-c-co {
44
+ @if ($co== 'main') {
45
+ &,
46
+ &[ui-tag~='#{$co}'] {
47
+ background: var(--co-#{$co});
48
+ }
49
+ } @else {
50
+ &[ui-tag~='#{$co}'] {
51
+ background: var(--co-#{$co});
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ // 群组
58
+ [ui-tags~='@c'] {
59
+ // 容器
60
+ & {
61
+ position: relative;
62
+ width: 100%;
63
+
64
+ &[ui-tags~='al'] {
65
+ & > * {
66
+ margin-right: 0.5rem;
67
+ }
68
+ }
69
+ &[ui-tags~='ac'] {
70
+ & > * {
71
+ margin-left: 0.5rem;
72
+ margin-right: 0.5rem;
73
+ }
74
+ }
75
+ &[ui-tags~='ar'] {
76
+ & > * {
77
+ margin-left: 0.5rem;
78
+ }
79
+ }
80
+ }
81
+
82
+ // 子项
83
+ & > * {
84
+ display: inline-block;
85
+ padding: 2px 0.5em;
86
+ border-radius: 10em;
87
+ font-weight: bold;
88
+ line-height: 1.25;
89
+ white-space: nowrap;
90
+ vertical-align: middle;
91
+ color: #fff;
92
+ }
93
+
94
+ // 圆角
95
+ &[ui-tags~=':round'] > * {
96
+ border-radius: 10em;
97
+ }
98
+ // 方角
99
+ &[ui-tags~=':square'] > * {
100
+ border-radius: 0.2rem;
101
+ }
102
+ // 叶型
103
+ &[ui-tags~=':leaf'] > * {
104
+ border-radius: 10em 0;
105
+ }
106
+ // 弹头
107
+ &[ui-tags~=':bullet'] > * {
108
+ border-radius: 1em 0.2em 0.2em 1em;
109
+ }
110
+
111
+ // 尺寸
112
+ &[ui-tags~='s'] > * {
113
+ padding: 1px 0.5em;
114
+ }
115
+ &[ui-tags~='m'] > * {
116
+ padding: 2px 0.5em;
117
+ }
118
+ &[ui-tags~='l'] > * {
119
+ padding: 3px 0.5em;
120
+ }
121
+
122
+ // 主题
123
+ @each $co in $tag-c-co {
124
+ @if ($co== 'main') {
125
+ & > *,
126
+ &[ui-tags~='#{$co}'] > * {
127
+ background: var(--co-#{$co});
128
+ }
129
+ } @else {
130
+ &[ui-tags~='#{$co}'] > * {
131
+ background: var(--co-#{$co});
132
+ }
133
+ }
134
+ }
135
+ }
package/core/media.scss CHANGED
@@ -1,364 +1,6 @@
1
+ @forward './query.scss';
2
+ @use './query.scss' as *;
1
3
  @use 'sass:list';
2
- @use 'sass:string';
3
-
4
- $level: (
5
- mob-s: 320px,
6
- mob-m: 480px,
7
- mob-l: 640px,
8
- pad-s: 800px,
9
- pad-m: 960px,
10
- pad-l: 1120px,
11
- dpc-s: 1280px,
12
- dpc-m: 1440px,
13
- dpc-l: 1600px
14
- );
15
-
16
- // 移动
17
- @mixin mob() {
18
- $this: #{list.nth(&, 1)};
19
- @media screen and (max-width: 799px) {
20
- @if ($this == '') {
21
- @content;
22
- } @else {
23
- & {
24
- @content;
25
- }
26
- }
27
- }
28
- }
29
- // 平板
30
- @mixin pad() {
31
- $this: #{list.nth(&, 1)};
32
- @media screen and (min-width: 800px) and (max-width: 1279px) {
33
- @if ($this == '') {
34
- @content;
35
- } @else {
36
- & {
37
- @content;
38
- }
39
- }
40
- }
41
- }
42
- // 桌面
43
- @mixin dpc() {
44
- $this: #{list.nth(&, 1)};
45
- @media screen and (min-width: 1280px) {
46
- @if ($this == '') {
47
- @content;
48
- } @else {
49
- & {
50
- @content;
51
- }
52
- }
53
- }
54
- }
55
-
56
- // 设备
57
- @mixin med($p) {
58
- $this: #{list.nth(&, 1)};
59
-
60
- $r: string.slice($p, 1, 1);
61
- $_n: string.slice($p, 2, -1);
62
-
63
- // 大于某节点时
64
- @if ($r == '>') {
65
- @if ($p == '>mob' or $p == '>mob-l') {
66
- @media screen and (min-width: 800px) {
67
- @if ($this == '') {
68
- @content;
69
- } @else {
70
- & {
71
- @content;
72
- }
73
- }
74
- }
75
- } @else if ($p == '>mob-s') {
76
- @media screen and (min-width: 480px) {
77
- @if ($this == '') {
78
- @content;
79
- } @else {
80
- & {
81
- @content;
82
- }
83
- }
84
- }
85
- } @else if ($p == '>mob-m') {
86
- @media screen and (min-width: 640px) {
87
- @if ($this == '') {
88
- @content;
89
- } @else {
90
- & {
91
- @content;
92
- }
93
- }
94
- }
95
- } @else if ($p == '>pad') {
96
- @media screen and (min-width: 1280px) {
97
- @if ($this == '') {
98
- @content;
99
- } @else {
100
- & {
101
- @content;
102
- }
103
- }
104
- }
105
- } @else if ($p == '>pad-s') {
106
- @media screen and (min-width: 960px) {
107
- @if ($this == '') {
108
- @content;
109
- } @else {
110
- & {
111
- @content;
112
- }
113
- }
114
- }
115
- } @else if ($p == '>pad-m') {
116
- @media screen and (min-width: 1120px) {
117
- @if ($this == '') {
118
- @content;
119
- } @else {
120
- & {
121
- @content;
122
- }
123
- }
124
- }
125
- } @else if ($p == '>dpc-s') {
126
- @media screen and (min-width: 1440px) {
127
- @if ($this == '') {
128
- @content;
129
- } @else {
130
- & {
131
- @content;
132
- }
133
- }
134
- }
135
- } @else if ($p == '>dpc-m') {
136
- @media screen and (min-width: 1600px) {
137
- @if ($this == '') {
138
- @content;
139
- } @else {
140
- & {
141
- @content;
142
- }
143
- }
144
- }
145
- } @else if ($p == '>pad-l') {
146
- @media screen and (min-width: 1280px) {
147
- @if ($this == '') {
148
- @content;
149
- } @else {
150
- & {
151
- @content;
152
- }
153
- }
154
- }
155
- }
156
- } @else if ($r == '<') {
157
- @if ($p == '<dpc-l') {
158
- @media screen and (max-width: 1599px) {
159
- @if ($this == '') {
160
- @content;
161
- } @else {
162
- & {
163
- @content;
164
- }
165
- }
166
- }
167
- } @else if ($p == '<dpc-m') {
168
- @media screen and (max-width: 1439px) {
169
- @if ($this == '') {
170
- @content;
171
- } @else {
172
- & {
173
- @content;
174
- }
175
- }
176
- }
177
- } @else if ($p == '<dpc-s' or $p == '<dpc') {
178
- @media screen and (max-width: 1279px) {
179
- @if ($this == '') {
180
- @content;
181
- } @else {
182
- & {
183
- @content;
184
- }
185
- }
186
- }
187
- } @else if ($p == '<pad-l') {
188
- @media screen and (max-width: 1119px) {
189
- @if ($this == '') {
190
- @content;
191
- } @else {
192
- & {
193
- @content;
194
- }
195
- }
196
- }
197
- } @else if ($p == '<pad-m') {
198
- @media screen and (max-width: 959px) {
199
- @if ($this == '') {
200
- @content;
201
- } @else {
202
- & {
203
- @content;
204
- }
205
- }
206
- }
207
- } @else if ($p == '<pad-s' or $p == '<pad') {
208
- @media screen and (max-width: 799px) {
209
- @if ($this == '') {
210
- @content;
211
- } @else {
212
- & {
213
- @content;
214
- }
215
- }
216
- }
217
- } @else if ($p == '<mob-l') {
218
- @media screen and (max-width: 639px) {
219
- @if ($this == '') {
220
- @content;
221
- } @else {
222
- & {
223
- @content;
224
- }
225
- }
226
- }
227
- } @else if ($p == '<mob-m') {
228
- @media screen and (max-width: 479px) {
229
- @if ($this == '') {
230
- @content;
231
- } @else {
232
- & {
233
- @content;
234
- }
235
- }
236
- }
237
- }
238
- } @else if ($r == '=') {
239
- @if ($p == '=dpc') {
240
- @media screen and (min-width: 1280px) {
241
- @if ($this == '') {
242
- @content;
243
- } @else {
244
- & {
245
- @content;
246
- }
247
- }
248
- }
249
- } @else if ($p == '=dpc-l') {
250
- @media screen and (min-width: 1600px) {
251
- @if ($this == '') {
252
- @content;
253
- } @else {
254
- & {
255
- @content;
256
- }
257
- }
258
- }
259
- } @else if ($p == '=dpc-m') {
260
- @media screen and (min-width: 1440px) and (max-width: 1599px) {
261
- @if ($this == '') {
262
- @content;
263
- } @else {
264
- & {
265
- @content;
266
- }
267
- }
268
- }
269
- } @else if ($p == '=dpc-s') {
270
- @media screen and (min-width: 1280px) and (max-width: 1439px) {
271
- @if ($this == '') {
272
- @content;
273
- } @else {
274
- & {
275
- @content;
276
- }
277
- }
278
- }
279
- } @else if ($p == '=pad') {
280
- @media screen and (min-width: 800px) and (max-width: 1279px) {
281
- @if ($this == '') {
282
- @content;
283
- } @else {
284
- & {
285
- @content;
286
- }
287
- }
288
- }
289
- } @else if ($p == '=pad-l') {
290
- @media screen and (min-width: 1120px) and (max-width: 1279px) {
291
- @if ($this == '') {
292
- @content;
293
- } @else {
294
- & {
295
- @content;
296
- }
297
- }
298
- }
299
- } @else if ($p == '=pad-m') {
300
- @media screen and (min-width: 960px) and (max-width: 1119px) {
301
- @if ($this == '') {
302
- @content;
303
- } @else {
304
- & {
305
- @content;
306
- }
307
- }
308
- }
309
- } @else if ($p == '=pad-s') {
310
- @media screen and (min-width: 800px) and (max-width: 959px) {
311
- @if ($this == '') {
312
- @content;
313
- } @else {
314
- & {
315
- @content;
316
- }
317
- }
318
- }
319
- } @else if ($p == '=mob') {
320
- @media screen and (max-width: 799px) {
321
- @if ($this == '') {
322
- @content;
323
- } @else {
324
- & {
325
- @content;
326
- }
327
- }
328
- }
329
- } @else if ($p == '=mob-l') {
330
- @media screen and (min-width: 640px) and (max-width: 799px) {
331
- @if ($this == '') {
332
- @content;
333
- } @else {
334
- & {
335
- @content;
336
- }
337
- }
338
- }
339
- } @else if ($p == '=mob-m') {
340
- @media screen and (min-width: 480px) and (max-width: 639px) {
341
- @if ($this == '') {
342
- @content;
343
- } @else {
344
- & {
345
- @content;
346
- }
347
- }
348
- }
349
- } @else if ($p == '=mob-s') {
350
- @media screen and (max-width: 479px) {
351
- @if ($this == '') {
352
- @content;
353
- } @else {
354
- & {
355
- @content;
356
- }
357
- }
358
- }
359
- }
360
- }
361
- }
362
4
 
363
5
  // 大于某节点时
364
6
  @each $sz in $level {