@neatui/css 1.0.2

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.
Files changed (226) hide show
  1. package/README.md +1 -0
  2. package/all.scss +22 -0
  3. package/anim/am-loading.scss +220 -0
  4. package/anim/am-rotate.scss +17 -0
  5. package/anim/am-view-aa.scss +91 -0
  6. package/anim/am-view-ab.scss +107 -0
  7. package/anim/am-view-ac.scss +114 -0
  8. package/anim/am-view-ad.scss +109 -0
  9. package/anim/am-view-ae.scss +109 -0
  10. package/anim/am-view-af.scss +104 -0
  11. package/anim/am-view-ag.scss +1789 -0
  12. package/anim/am-view-ah.scss +122 -0
  13. package/anim/am-view-ai.scss +116 -0
  14. package/anim/am-view-aj.scss +112 -0
  15. package/anim/am-view-ak.scss +102 -0
  16. package/anim/am-view-al.scss +98 -0
  17. package/anim/am-view-am.scss +97 -0
  18. package/anim/am-view-an.scss +109 -0
  19. package/anim/am-view-ao.scss +123 -0
  20. package/anim/am-view-ap.scss +108 -0
  21. package/anim/am-view-aq.scss +115 -0
  22. package/anim/am-view-ar.scss +113 -0
  23. package/anim/am-view-as.scss +99 -0
  24. package/anim/am-view-at.scss +103 -0
  25. package/anim/mcui@anim.scss +22 -0
  26. package/anim/package.json +16 -0
  27. package/badge/badge@theme=aa.scss +36 -0
  28. package/badge/package.json +22 -0
  29. package/btns/README.md +79 -0
  30. package/btns/base.scss +152 -0
  31. package/btns/btns@a.scss +469 -0
  32. package/btns/btns@b.scss +187 -0
  33. package/btns/btns@c.scss +169 -0
  34. package/btns/mcui@btns.scss +3 -0
  35. package/btns/package.json +16 -0
  36. package/card/card@a.scss +238 -0
  37. package/card/card@b.scss +75 -0
  38. package/card/mcui@card.scss +2 -0
  39. package/card/package.json +15 -0
  40. package/chat/chat@a.scss +139 -0
  41. package/chat/mcui@chat.scss +1 -0
  42. package/chat/package.json +11 -0
  43. package/cite/cite@a.scss +33 -0
  44. package/cite/package.json +11 -0
  45. package/core/README.md +142 -0
  46. package/core/base.scss +544 -0
  47. package/core/border.scss +307 -0
  48. package/core/color.scss +245 -0
  49. package/core/cols.scss +148 -0
  50. package/core/cover.scss +94 -0
  51. package/core/flex.scss +616 -0
  52. package/core/line.scss +4 -0
  53. package/core/margin.scss +0 -0
  54. package/core/mcui@core.scss +36 -0
  55. package/core/mcui@mobile.scss +37 -0
  56. package/core/media.scss +268 -0
  57. package/core/package.json +16 -0
  58. package/core/padding.scss +0 -0
  59. package/core/pos.scss +252 -0
  60. package/core/reset.scss +165 -0
  61. package/core/scale.scss +24 -0
  62. package/core/scroll.scss +178 -0
  63. package/core/shadow.scss +81 -0
  64. package/core/size.mobile.scss +105 -0
  65. package/core/size.scss +178 -0
  66. package/core/theme.scss +156 -0
  67. package/core/trim.mobile.scss +327 -0
  68. package/core/trim.scss +443 -0
  69. package/core/ux.scss +334 -0
  70. package/demo/demo@a.scss +34 -0
  71. package/demo/mcui@demo.scss +1 -0
  72. package/form/README.md +142 -0
  73. package/form/base.scss +425 -0
  74. package/form/form@a/base.scss +33 -0
  75. package/form/form@a/checkbox.scss +194 -0
  76. package/form/form@a/date.scss +86 -0
  77. package/form/form@a/index.scss +9 -0
  78. package/form/form@a/input.scss +156 -0
  79. package/form/form@a/radio.scss +99 -0
  80. package/form/form@a/select.scss +128 -0
  81. package/form/form@a/switch.scss +83 -0
  82. package/form/form@a/textarea.scss +105 -0
  83. package/form/form@a/upload.scss +162 -0
  84. package/form/form@b/base.scss +33 -0
  85. package/form/form@b/checkbox.scss +86 -0
  86. package/form/form@b/date.scss +107 -0
  87. package/form/form@b/index.scss +9 -0
  88. package/form/form@b/input.scss +163 -0
  89. package/form/form@b/radio.scss +90 -0
  90. package/form/form@b/select.scss +124 -0
  91. package/form/form@b/switch.scss +83 -0
  92. package/form/form@b/textarea.scss +105 -0
  93. package/form/form@b/upload.scss +160 -0
  94. package/form/form@c/base.scss +44 -0
  95. package/form/form@c/checkbox.scss +90 -0
  96. package/form/form@c/date.scss +125 -0
  97. package/form/form@c/index.scss +9 -0
  98. package/form/form@c/input.scss +169 -0
  99. package/form/form@c/radio.scss +84 -0
  100. package/form/form@c/select.scss +121 -0
  101. package/form/form@c/switch.scss +83 -0
  102. package/form/form@c/textarea.scss +85 -0
  103. package/form/form@c/upload.scss +159 -0
  104. package/form/form@d/base.scss +45 -0
  105. package/form/form@d/checkbox.scss +87 -0
  106. package/form/form@d/date.scss +125 -0
  107. package/form/form@d/index.scss +9 -0
  108. package/form/form@d/input.scss +346 -0
  109. package/form/form@d/radio.scss +81 -0
  110. package/form/form@d/select.scss +121 -0
  111. package/form/form@d/switch.scss +83 -0
  112. package/form/form@d/textarea.scss +104 -0
  113. package/form/form@d/upload.scss +160 -0
  114. package/form/mcui@form.scss +4 -0
  115. package/form/package.json +22 -0
  116. package/form/radio@theme=aa.scss +74 -0
  117. package/grid/grid@a.scss +54 -0
  118. package/grid/mcui@grid.scss +1 -0
  119. package/grid/package.json +16 -0
  120. package/icon/icon@add.scss +9 -0
  121. package/icon/icon@close.scss +12 -0
  122. package/icon/icon@down.scss +9 -0
  123. package/icon/icon@download.scss +26 -0
  124. package/icon/icon@drag.scss +9 -0
  125. package/icon/icon@except.scss +9 -0
  126. package/icon/icon@hook.scss +16 -0
  127. package/icon/icon@left.scss +9 -0
  128. package/icon/icon@link.scss +14 -0
  129. package/icon/icon@menu.scss +10 -0
  130. package/icon/icon@minus.scss +7 -0
  131. package/icon/icon@more.scss +8 -0
  132. package/icon/icon@omit.scss +8 -0
  133. package/icon/icon@quit.scss +11 -0
  134. package/icon/icon@refresh.scss +11 -0
  135. package/icon/icon@right.scss +9 -0
  136. package/icon/icon@search.scss +9 -0
  137. package/icon/icon@time.scss +12 -0
  138. package/icon/icon@top.scss +9 -0
  139. package/icon/icon@upload.scss +26 -0
  140. package/icon/icon@view.scss +20 -0
  141. package/icon/mcui@icon.scss +21 -0
  142. package/icon/package.json +15 -0
  143. package/imgs/README.md +78 -0
  144. package/imgs/base.scss +8 -0
  145. package/imgs/imgs@a.scss +171 -0
  146. package/imgs/imgs@b.scss +173 -0
  147. package/imgs/mcui@imgs.scss +1 -0
  148. package/imgs/package.json +16 -0
  149. package/index.js +28 -0
  150. package/line/line@a.scss +51 -0
  151. package/line/line@b.scss +63 -0
  152. package/line/mcui@line.scss +2 -0
  153. package/line/package.json +16 -0
  154. package/list/list@a.scss +62 -0
  155. package/list/list@b.scss +83 -0
  156. package/list/list@c.scss +89 -0
  157. package/list/mcui@list.scss +2 -0
  158. package/list/package.json +16 -0
  159. package/load/README.md +69 -0
  160. package/load/load@a.scss +44 -0
  161. package/load/load@b.scss +56 -0
  162. package/load/load@c.scss +270 -0
  163. package/load/load@d.scss +26 -0
  164. package/load/load@e.scss +24 -0
  165. package/load/load@f.scss +124 -0
  166. package/load/load@g.scss +35 -0
  167. package/load/load@h.scss +51 -0
  168. package/load/load@i.scss +51 -0
  169. package/load/mcui@load.scss +8 -0
  170. package/load/package.json +16 -0
  171. package/menu/mcui@menu.scss +1 -0
  172. package/menu/menu@b.scss +302 -0
  173. package/menu/menu@theme=ab.scss +282 -0
  174. package/menu/package.json +22 -0
  175. package/navs/README.md +30 -0
  176. package/navs/mcui@navs.scss +2 -0
  177. package/navs/navs@a.scss +113 -0
  178. package/navs/navs@b.scss +111 -0
  179. package/navs/package.json +16 -0
  180. package/note/mcui@note.scss +2 -0
  181. package/note/note@a.scss +26 -0
  182. package/note/note@b.scss +33 -0
  183. package/note/package.json +11 -0
  184. package/opts/mcui@opts.scss +1 -0
  185. package/opts/opts@a.scss +52 -0
  186. package/opts/package.json +11 -0
  187. package/package.json +26 -0
  188. package/paging/mc-paging-ui1503.scss +106 -0
  189. package/paging/mc-paging.scss +432 -0
  190. package/paging/paging@theme=aa.scss +45 -0
  191. package/path/README.md +142 -0
  192. package/path/mcui@path.scss +1 -0
  193. package/path/package.json +22 -0
  194. package/path/path@a.scss +38 -0
  195. package/side/mcui@side.scss +0 -0
  196. package/side/side.scss +2 -0
  197. package/steps/mcui@steps.scss +2 -0
  198. package/steps/package.json +17 -0
  199. package/steps/steps@a.scss +89 -0
  200. package/steps/steps@v.scss +122 -0
  201. package/table/base.scss +140 -0
  202. package/table/mcui@table.scss +3 -0
  203. package/table/package.json +22 -0
  204. package/table/table@a.scss +230 -0
  205. package/table/table@b.scss +78 -0
  206. package/table/table@c.scss +18 -0
  207. package/tabs/README.md +62 -0
  208. package/tabs/mcui@tabs.scss +1 -0
  209. package/tabs/package.json +22 -0
  210. package/tabs/tabs@a.scss +62 -0
  211. package/tags/README.md +71 -0
  212. package/tags/mcui@tags.scss +2 -0
  213. package/tags/package.json +22 -0
  214. package/tags/tags@a.scss +125 -0
  215. package/tags/tags@b.scss +131 -0
  216. package/tips/README.md +62 -0
  217. package/tips/base.scss +351 -0
  218. package/tips/mcui@tips.scss +1 -0
  219. package/tips/package.json +22 -0
  220. package/tips/tips@a.scss +52 -0
  221. package/title/mcui@title.scss +2 -0
  222. package/title/package.json +15 -0
  223. package/title/title@a.scss +18 -0
  224. package/title/title@b.scss +7 -0
  225. package/user/mcui@user.scss +0 -0
  226. package/user/user@a.scss +7 -0
@@ -0,0 +1,469 @@
1
+ @use 'sass:math';
2
+ $size: xs, s, m, l, xl;
3
+ $type: none, main, vice, text, link, read, note, case, line, weak, back, info, well, warn, risk, w, b;
4
+
5
+ // 基础
6
+ %btnBase {
7
+ & {
8
+ position: relative;
9
+ display: inline-flex;
10
+ flex-direction: row;
11
+ justify-content: center;
12
+ align-items: center;
13
+ align-content: center;
14
+ height: 2.5em;
15
+ padding: 0 1em;
16
+ border-radius: 0.25em;
17
+ cursor: pointer;
18
+ transition: all 50ms;
19
+ text-align: center;
20
+ vertical-align: middle;
21
+ border: 0;
22
+ user-select: none;
23
+ white-space: nowrap;
24
+ color: inherit;
25
+ box-shadow: inset 0 0 0 1px currentColor;
26
+ @include theme {
27
+ background: co(weak);
28
+ }
29
+ }
30
+
31
+ & > * {
32
+ &.icon {
33
+ display: inline-block;
34
+ & + * {
35
+ margin-left: 0.2em;
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ // 按钮
42
+ body [ui-btn~='@a'] {
43
+ // 基础样式
44
+ @extend %btnBase;
45
+
46
+ // &[ui-btn~=':flex'] {
47
+ // display: inline-flex;
48
+ // justify-content: center;
49
+ // align-items: center;
50
+ // }
51
+
52
+ // 绝对尺寸
53
+ &[ui-btn~=':abs'] {
54
+ height: 2.5rem;
55
+ line-height: 2.5rem;
56
+ padding: 0 1rem;
57
+ border-radius: 0.25rem;
58
+ }
59
+ // 圆弧按钮
60
+ &[ui-btn~=':round'] {
61
+ border-radius: 100em;
62
+ }
63
+
64
+ // 移入状态
65
+ &:hover {
66
+ @include theme {
67
+ box-shadow:
68
+ inset 0 0 0 1px co(line),
69
+ inset 0 0 0 100em rgba(co(text), 0.04);
70
+ }
71
+ }
72
+
73
+ // 按下状态
74
+ &:active {
75
+ transform: scale(0.98, 0.95);
76
+ }
77
+
78
+ // 正方形按钮
79
+ &[ui-btn~=':square'] {
80
+ width: 2.5em;
81
+ padding: 0;
82
+ }
83
+
84
+ // 块状按钮
85
+ &[ui-btn~=':block'] {
86
+ width: 100%;
87
+ }
88
+
89
+ // 禁用按钮
90
+ &[ui-btn~=':disabled'] {
91
+ &,
92
+ &:hover {
93
+ opacity: 0.65;
94
+ box-shadow:
95
+ inset 0 0 0 1px transparent,
96
+ inset 0 0 0 100em rgba(0, 0, 0, 0);
97
+ cursor: not-allowed;
98
+ }
99
+ &:active {
100
+ transform: scale(1, 1);
101
+ cursor: not-allowed;
102
+ }
103
+ }
104
+
105
+ // 按钮尺寸
106
+ $base: 1.5;
107
+ @each $i in $size {
108
+ &[ui-btn~='#{$i}'] {
109
+ height: #{$base}em;
110
+ // line-height: #{$base}em;
111
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
112
+
113
+ // 方形按钮
114
+ &[ui-btn~=':square'] {
115
+ width: #{$base}em;
116
+ padding: 0;
117
+ }
118
+
119
+ &[ui-btn~=':abs'] {
120
+ height: #{$base}rem;
121
+ // line-height: #{$base}rem;
122
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
123
+ }
124
+ }
125
+
126
+ @include med('=mob') {
127
+ &[ui-btn~='mob-#{$i}'] {
128
+ height: #{$base}em;
129
+ // line-height: #{$base}em;
130
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
131
+
132
+ // 方形按钮
133
+ &[ui-btn~=':square'] {
134
+ width: #{$base}em;
135
+ padding: 0;
136
+ }
137
+
138
+ &[ui-btn~=':abs'] {
139
+ height: #{$base}rem;
140
+ // line-height: #{$base}rem;
141
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
142
+ }
143
+ }
144
+ }
145
+ @include med('=pad') {
146
+ &[ui-btn~='pad-#{$i}'] {
147
+ height: #{$base}em;
148
+ // line-height: #{$base}em;
149
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
150
+
151
+ // 方形按钮
152
+ &[ui-btn~=':square'] {
153
+ width: #{$base}em;
154
+ padding: 0;
155
+ }
156
+
157
+ &[ui-btn~=':abs'] {
158
+ height: #{$base}rem;
159
+ // line-height: #{$base}rem;
160
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
161
+ }
162
+ }
163
+ }
164
+
165
+ $base: $base + 0.5;
166
+ }
167
+
168
+ // 按钮颜色
169
+ @each $name in $type {
170
+ &[ui-btn~='#{$name}'] {
171
+ @if ($name == 'none' or $name == 'weak' or $name == 'back') {
172
+ @include theme {
173
+ background: co($name);
174
+ }
175
+ color: inherit;
176
+ } @else {
177
+ @include theme {
178
+ // 背景色
179
+ background: co($name);
180
+ color: co(fore);
181
+ }
182
+ }
183
+ box-shadow: inset 0 0 0 1px transparent;
184
+
185
+ &:hover {
186
+ @include theme {
187
+ box-shadow:
188
+ inset 0 0 0 1px transparent,
189
+ inset 0 0 0 100em rgba(co(text), 0.04);
190
+ }
191
+ }
192
+
193
+ // 边框式
194
+ &[ui-btn~=':border'] {
195
+ background: transparent;
196
+ @if ($name == 'line' or $name == 'case') {
197
+ @include theme {
198
+ color: co(read);
199
+ }
200
+ } @else {
201
+ @include theme {
202
+ color: co($name);
203
+ }
204
+ }
205
+ @include theme {
206
+ box-shadow: inset 0 0 0 1px co($name);
207
+ }
208
+
209
+ &:hover {
210
+ @include theme {
211
+ box-shadow:
212
+ inset 0 0 0 1px co($name),
213
+ inset 0 0 0 100em rgba(co($name), 0.08);
214
+ }
215
+ }
216
+ }
217
+
218
+ // 下划线
219
+ &[ui-btn~=':underline'] {
220
+ @include theme {
221
+ color: co($name);
222
+ }
223
+ background: transparent;
224
+ box-shadow: inset 0 0 0 1px transparent;
225
+
226
+ &:hover {
227
+ box-shadow: inset 0 0 0 1px transparent;
228
+ text-decoration: underline;
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ // 群组
236
+ [ui-btns~='@a'] {
237
+ // 群组模式
238
+ &[ui-btns~=':group'] {
239
+ & > * {
240
+ border-radius: 0;
241
+ margin-right: -1px;
242
+
243
+ // 普通倒角
244
+ &:first-child {
245
+ border-radius: 0.25em 0 0 0.25em;
246
+ }
247
+ &:last-child {
248
+ border-radius: 0 0.25em 0.25em 0;
249
+ }
250
+ }
251
+ // 圆弧倒角
252
+ &[ui-btns~=':round'] > * {
253
+ border-radius: 0;
254
+
255
+ // 普通倒角
256
+ &:first-child {
257
+ border-radius: 100em 0 0 100em;
258
+ }
259
+ &:last-child {
260
+ border-radius: 0 100em 100em 0;
261
+ }
262
+ }
263
+
264
+ & {
265
+ display: inline-flex;
266
+ }
267
+ }
268
+
269
+ // 基础样式
270
+ & > * {
271
+ @extend %btnBase;
272
+ }
273
+
274
+ &[ui-btns~=':flex'] > * {
275
+ display: inline-flex;
276
+ justify-content: center;
277
+ align-items: center;
278
+ }
279
+
280
+ // 绝对尺寸
281
+ &[ui-btns~=':abs'] > * {
282
+ height: 2.5rem;
283
+ padding: 0 1rem;
284
+ border-radius: 0.25rem;
285
+ }
286
+ // 圆弧按钮
287
+ &[ui-btns~=':round'] > * {
288
+ border-radius: 100em;
289
+ }
290
+
291
+ // 移入状态
292
+ & > *:hover {
293
+ @include theme {
294
+ box-shadow:
295
+ inset 0 0 0 1px co(line),
296
+ inset 0 0 0 100em rgba(co(text), 0.04);
297
+ }
298
+ }
299
+
300
+ // 按下状态
301
+ & > *:active {
302
+ transform: scale(0.98, 0.95);
303
+ }
304
+
305
+ // 正方形按钮
306
+ &[ui-btns~=':square'] > * {
307
+ width: 2.5em;
308
+ padding: 0;
309
+ }
310
+
311
+ // 块状按钮
312
+ &[ui-btns~=':block'] > * {
313
+ width: 100%;
314
+ }
315
+
316
+ // 禁用按钮
317
+ &[ui-btns~=':disabled'] > * {
318
+ &,
319
+ &:hover {
320
+ opacity: 0.65;
321
+ box-shadow:
322
+ inset 0 0 0 1px transparent,
323
+ inset 0 0 0 100em rgba(0, 0, 0, 0);
324
+ cursor: not-allowed;
325
+ }
326
+ &:active {
327
+ transform: scale(1, 1);
328
+ cursor: not-allowed;
329
+ }
330
+ }
331
+
332
+ // 按钮尺寸
333
+ $base: 1.5;
334
+ @each $i in $size {
335
+ &[ui-btns~='#{$i}'] {
336
+ & > * {
337
+ height: #{$base}em;
338
+ // line-height: #{$base}em;
339
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
340
+ }
341
+
342
+ // 方形按钮
343
+ &[ui-btns~=':square'] > * {
344
+ width: #{$base}em;
345
+ padding: 0;
346
+ }
347
+
348
+ &[ui-btns~=':abs'] > * {
349
+ height: #{$base}rem;
350
+ // line-height: #{$base}rem;
351
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
352
+ }
353
+ }
354
+
355
+ @include med('=mob') {
356
+ &[ui-btns~='mob-#{$i}'] {
357
+ & > * {
358
+ height: #{$base}em;
359
+ // line-height: #{$base}em;
360
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
361
+ }
362
+
363
+ // 方形按钮
364
+ &[ui-btns~=':square'] > * {
365
+ width: #{$base}em;
366
+ padding: 0;
367
+ }
368
+
369
+ &[ui-btns~=':abs'] > * {
370
+ height: #{$base}rem;
371
+ // line-height: #{$base}rem;
372
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
373
+ }
374
+ }
375
+ }
376
+ @include med('=pad') {
377
+ &[ui-btns~='pad-#{$i}'] {
378
+ & > * {
379
+ height: #{$base}em;
380
+ // line-height: #{$base}em;
381
+ padding: 0 #{calc(($base - 0.5) / 2)}em;
382
+ }
383
+
384
+ // 方形按钮
385
+ &[ui-btns~=':square'] > * {
386
+ width: #{$base}em;
387
+ padding: 0;
388
+ }
389
+
390
+ &[ui-btns~=':abs'] > * {
391
+ height: #{$base}rem;
392
+ // line-height: #{$base}rem;
393
+ padding: 0 #{calc(($base - 0.5) / 2)}rem;
394
+ }
395
+ }
396
+ }
397
+
398
+ $base: $base + 0.5;
399
+ }
400
+
401
+ // 按钮颜色
402
+ @each $name in $type {
403
+ &[ui-btns~='#{$name}'] {
404
+ & > * {
405
+ @if ($name == 'none' or $name == 'weak' or $name == 'back') {
406
+ @include theme {
407
+ background: co($name);
408
+ }
409
+ color: inherit;
410
+ } @else {
411
+ @include theme {
412
+ // 背景色
413
+ background: co($name);
414
+ color: co(fore);
415
+ }
416
+ }
417
+
418
+ box-shadow: inset 0 0 0 1px transparent;
419
+
420
+ &:hover {
421
+ @include theme {
422
+ box-shadow:
423
+ inset 0 0 0 1px transparent,
424
+ inset 0 0 0 100em rgba(co(text), 0.04);
425
+ }
426
+ }
427
+ }
428
+
429
+ // 边框式
430
+ &[ui-btns~=':border'] > * {
431
+ background: transparent;
432
+ @if ($name == 'line') {
433
+ @include theme {
434
+ color: co(read);
435
+ }
436
+ } @else {
437
+ @include theme {
438
+ color: co($name);
439
+ }
440
+ }
441
+ @include theme {
442
+ box-shadow: inset 0 0 0 1px co($name);
443
+ }
444
+
445
+ &:hover {
446
+ @include theme {
447
+ box-shadow:
448
+ inset 0 0 0 1px co($name),
449
+ inset 0 0 0 100em rgba(co($name), 0.08);
450
+ }
451
+ }
452
+ }
453
+
454
+ // 下划线
455
+ &[ui-btns~=':underline'] > * {
456
+ @include theme {
457
+ color: co($name);
458
+ }
459
+ background: transparent;
460
+ box-shadow: inset 0 0 0 1px transparent;
461
+
462
+ &:hover {
463
+ box-shadow: inset 0 0 0 1px transparent;
464
+ text-decoration: underline;
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
@@ -0,0 +1,187 @@
1
+ @use 'sass:math';
2
+ $size: 'xs', 's', 'm', 'l', 'xl';
3
+ $type: 'none', 'main', 'vice', 'text', 'read', 'weak', 'back', 'info', 'well', 'warn', 'risk';
4
+
5
+ // 按钮
6
+ [ui-btn~='@b'] {
7
+ // 基础样式
8
+ & {
9
+ position: relative;
10
+ display: inline-table;
11
+ height: 2.5em;
12
+ line-height: 2.5em;
13
+ padding: 0 1em;
14
+ border-radius: 0.25em;
15
+ cursor: pointer;
16
+ transition: all 50ms;
17
+ text-align: center;
18
+ vertical-align: middle;
19
+ // -webkit-font-smoothing: auto;
20
+ // -moz-osx-font-smoothing: auto;
21
+ border: 0;
22
+ user-select: none;
23
+ white-space: nowrap;
24
+ @include theme {
25
+ color: co(text);
26
+ background: co(weak);
27
+ box-shadow: inset 0 0 0 1px co(line);
28
+ }
29
+ }
30
+
31
+ & > * {
32
+ &.icon {
33
+ display: inline-block;
34
+ & + * {
35
+ margin-left: 0.2em;
36
+ }
37
+ }
38
+ }
39
+
40
+ // 绝对尺寸
41
+ &[ui-btn~=':abs'] {
42
+ height: 2.5rem;
43
+ line-height: 2.5rem;
44
+ padding: 0 1rem;
45
+ border-radius: 0.25rem;
46
+ }
47
+ // 圆弧按钮
48
+ &[ui-btn~=':round'] {
49
+ border-radius: 100em;
50
+ }
51
+
52
+ // 移入状态
53
+ &:hover {
54
+ @include theme {
55
+ box-shadow:
56
+ inset 0 0 0 1px co(line),
57
+ inset 0 0 0 100em rgba(co(text), 0.04);
58
+ }
59
+ }
60
+
61
+ // 按下状态
62
+ &:active {
63
+ transform: scale(0.98, 0.95);
64
+ }
65
+
66
+ // 正方形按钮
67
+ &[ui-btn~=':square'] {
68
+ width: 2.5em;
69
+ padding: 0;
70
+ }
71
+
72
+ // 禁用按钮
73
+ &[ui-btn~=':disabled'] {
74
+ &,
75
+ &:hover {
76
+ opacity: 0.65;
77
+ box-shadow:
78
+ inset 0 0 0 1px transparent,
79
+ inset 0 0 0 100em rgba(0, 0, 0, 0);
80
+ cursor: not-allowed;
81
+ }
82
+ &:active {
83
+ transform: scale(1, 1);
84
+ cursor: not-allowed;
85
+ }
86
+ }
87
+
88
+ // 按钮尺寸
89
+ $base: 1.5;
90
+ @each $i in $size {
91
+ &[ui-btn~='#{$i}'] {
92
+ height: #{$base}em;
93
+ line-height: #{$base}em;
94
+ padding: 0 #{calc(($base - 1) / 2)}em;
95
+
96
+ // 方形按钮
97
+ &[ui-btn~=':square'] {
98
+ width: #{$base}em;
99
+ padding: 0;
100
+ }
101
+
102
+ &[ui-btn~=':block'] {
103
+ width: 100%;
104
+ }
105
+
106
+ &[ui-btn~=':abs'] {
107
+ height: #{$base}rem;
108
+ line-height: #{$base}rem;
109
+ padding: 0 #{calc(($base - 1) / 2)}rem;
110
+ }
111
+ }
112
+ $base: $base + 0.5;
113
+ }
114
+
115
+ // 按钮颜色
116
+ @each $name in $type {
117
+ &[ui-btn~='#{$name}'] {
118
+ @if ($name == 'none' or $name == 'weak' or $name == 'back') {
119
+ @include theme {
120
+ background: co($name);
121
+ }
122
+ color: inherit;
123
+ } @else {
124
+ @include theme {
125
+ // 背景色
126
+ $co: co($name);
127
+ background-image: linear-gradient(180deg, saturate($co, 5%) 0%, mix($co, co(text), 80%) 100%);
128
+ box-shadow: inset 0 -0.3em 0 0 rgba(0, 0, 0, 0.15);
129
+
130
+ // 智能计算文字颜色
131
+ // $wd: lightness($co) - (saturation($co) / 3);
132
+ // @if ($wd < 60%) {
133
+ // color: #fff;
134
+ // } @else {
135
+ // color: co(back);
136
+ // }
137
+ color: co(back);
138
+ }
139
+ }
140
+ box-shadow: inset 0 0 0 1px transparent;
141
+
142
+ &:hover {
143
+ @include theme {
144
+ box-shadow:
145
+ inset 0 0 0 1px transparent,
146
+ inset 0 0 0 100em rgba(co(text), 0.04);
147
+ }
148
+ }
149
+
150
+ // 边框式
151
+ &[ui-btn~=':border'] {
152
+ background: transparent;
153
+ @include theme {
154
+ color: co($name);
155
+ box-shadow:
156
+ inset 0 0 0 1px co($name),
157
+ inset 0 -0.2em 0 0 co(back),
158
+ inset 0 -0.3em 0 0 co($name);
159
+ }
160
+
161
+ &:hover {
162
+ @include theme {
163
+ box-shadow:
164
+ inset 0 0 0 1px co($name),
165
+ inset 0 -0.2em 0 0 co(back),
166
+ inset 0 -0.3em 0 0 co($name),
167
+ inset 0 0 0 100em rgba(co($name), 0.08);
168
+ }
169
+ }
170
+ }
171
+
172
+ // 下划线
173
+ &[ui-btn~=':underline'] {
174
+ @include theme {
175
+ color: co($name);
176
+ }
177
+ background: transparent;
178
+ box-shadow: inset 0 0 0 1px transparent;
179
+
180
+ &:hover {
181
+ box-shadow: inset 0 0 0 1px transparent;
182
+ text-decoration: underline;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }