@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,162 @@
1
+ @use 'sass:math';
2
+
3
+ [ui-form~='@a'] {
4
+ &[ui-form~='type:upload'] {
5
+ position: relative;
6
+ display: inline-flex;
7
+
8
+ &[ui-form~=':block'] {
9
+ display: flex;
10
+ }
11
+
12
+ %item {
13
+ position: relative;
14
+ width: 7.5rem;
15
+ height: 7.5rem;
16
+ display: inline-flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ justify-items: center;
20
+ border-radius: 0.25em;
21
+ padding: 0.5em;
22
+ text-align: center;
23
+ overflow: hidden;
24
+ transition: all 0.5s;
25
+ border-style: solid;
26
+ border-width: 1px;
27
+ @include theme {
28
+ border-color: co(case);
29
+ background-color: co(fore);
30
+ }
31
+ }
32
+
33
+ @keyframes am-file-add {
34
+ 0% {
35
+ }
36
+ 100% {
37
+ }
38
+ }
39
+ @keyframes am-file-del {
40
+ 0% {
41
+ opacity: 1;
42
+ }
43
+ 30% {
44
+ margin: 0.5em 1.5em 1.5em 0.5em;
45
+ opacity: 0;
46
+ }
47
+ 100% {
48
+ width: 0;
49
+ height: 0;
50
+ margin: 0;
51
+ opacity: 0;
52
+ padding: 0;
53
+ }
54
+ }
55
+
56
+ [ui-form-files] {
57
+ position: relative;
58
+ display: flex;
59
+ flex-direction: row;
60
+ flex-wrap: wrap;
61
+
62
+ & > * {
63
+ @extend %item;
64
+
65
+ &::after {
66
+ content: '';
67
+ position: absolute;
68
+ display: block;
69
+ width: 100%;
70
+ height: 0.5em;
71
+ top: 0;
72
+ left: 0;
73
+
74
+ @include theme {
75
+ background-color: co(fore);
76
+ }
77
+ }
78
+
79
+ img,
80
+ svg,
81
+ video {
82
+ max-width: 100%;
83
+ max-height: 100%;
84
+ border-radius: 0.15em;
85
+ transform: translate3d(0, 0, 0);
86
+ transition: all 0.5s;
87
+ transform-origin: 50% 0%;
88
+ }
89
+ // 进度条
90
+ [ui-form-file-progress] {
91
+ position: absolute;
92
+ width: 100%;
93
+ height: 100%;
94
+ @include theme {
95
+ background-color: rgba(co(fore), 0.85);
96
+ }
97
+ top: 0;
98
+ right: 0;
99
+ }
100
+
101
+ // 工具栏
102
+ [ui-form-file-tools] {
103
+ position: absolute;
104
+ height: 1.5em;
105
+ width: 100%;
106
+ opacity: 0;
107
+ pointer-events: none;
108
+ transition: all 0.5s;
109
+ bottom: 0em;
110
+ left: 0;
111
+ transform: translate3d(0, 2em, 0);
112
+
113
+ & > * {
114
+ width: 1.5em;
115
+ height: 1.5em;
116
+ border-radius: 50%;
117
+ }
118
+ }
119
+ &:hover {
120
+ [ui-form-file-tools] {
121
+ opacity: 1;
122
+ pointer-events: auto;
123
+ transform: translate3d(0, -0.5em, 0);
124
+ }
125
+ img,
126
+ svg,
127
+ video {
128
+ border-radius: 1em;
129
+ transform: translate3d(0, -2em, 0);
130
+ }
131
+ }
132
+
133
+ // 删除时
134
+ &.deling {
135
+ animation: am-file-del 0.35s forwards;
136
+ }
137
+ }
138
+ }
139
+
140
+ [ui-form-input] {
141
+ @extend %item;
142
+ border-style: dashed;
143
+ @include theme {
144
+ border-color: co(case);
145
+ }
146
+ input {
147
+ position: absolute;
148
+ width: 100%;
149
+ height: 100%;
150
+ left: 0;
151
+ top: 0;
152
+ opacity: 0;
153
+
154
+ &:-webkit-autofill {
155
+ @include theme {
156
+ box-shadow: 0 0 0 1000px co(fore) inset;
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
@@ -0,0 +1,33 @@
1
+ @use 'sass:math';
2
+ // 全局共用
3
+ @import '../base.scss';
4
+
5
+ // 主题共用
6
+ [ui-form~='@b'] {
7
+ // 禁用
8
+ &[ui-form~='disabled'] {
9
+ cursor: not-allowed;
10
+ opacity: 0.5;
11
+ }
12
+
13
+ // 撑满
14
+ &[ui-form~=':block'] {
15
+ display: flex;
16
+ width: 100%;
17
+ flex-grow: 1;
18
+ flex-shrink: 1;
19
+ }
20
+
21
+ // 圆弧
22
+ &[ui-form~=':round'] {
23
+ border-radius: 50em;
24
+ }
25
+
26
+ input:-webkit-autofill {
27
+ @include theme {
28
+ box-shadow: 0 0 0 1000px co(fore) inset;
29
+ color: co(read);
30
+ -webkit-text-fill-color: co(read);
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ 属性 描述
3
+ disabled 规定输入字段应该被禁用。
4
+ max 规定输入字段的最大值。
5
+ maxlength 规定输入字段的最大字符数。
6
+ min 规定输入字段的最小值。
7
+ pattern 规定通过其检查输入值的正则表达式。
8
+ readonly 规定输入字段为只读(无法修改)。
9
+ required 规定输入字段是必需的(必需填写)。
10
+ size 规定输入字段的宽度(以字符计)。
11
+ step 规定输入字段的合法数字间隔。
12
+ value 规定输入字段的默认值。
13
+ */
14
+ @use 'sass:math';
15
+ $co: 'info', 'well', 'warn', 'risk';
16
+
17
+ @keyframes am-b-checked {
18
+ 0% {
19
+ transform: scale3d(0.9, 0.9, 1);
20
+ }
21
+ 50% {
22
+ transform: scale3d(1, 1, 1);
23
+ }
24
+ 100% {
25
+ transform: scale3d(0.9, 0.9, 1);
26
+ }
27
+ }
28
+
29
+ [ui-form~='@b'] {
30
+ // 复选框
31
+ &[ui-form~='type:checkbox'] {
32
+ position: relative;
33
+ display: inline-flex;
34
+ align-items: center;
35
+ align-content: center;
36
+ flex-wrap: nowrap;
37
+ vertical-align: middle;
38
+ user-select: none;
39
+
40
+ &[ui-form~='lt'] {
41
+ align-items: baseline;
42
+ [type='checkbox'] {
43
+ position: relative;
44
+ top: 0.15em;
45
+ }
46
+ }
47
+
48
+ [type='checkbox'] {
49
+ appearance: none;
50
+ font-size: inherit;
51
+ width: 0.95em;
52
+ height: 0.95em;
53
+ border: 0;
54
+ margin: 0;
55
+ padding: 0;
56
+ background: transparent;
57
+ box-shadow: inset 0 0 0 1px currentColor;
58
+ border-radius: 0.2em;
59
+ flex-shrink: 0;
60
+
61
+ &:checked {
62
+ background: radial-gradient(circle at 23% 43.3%, currentColor 5%, transparent 6%), radial-gradient(circle at 26% 46%, currentColor 5.5%, transparent 6.5%),
63
+ radial-gradient(circle at 29% 49%, currentColor 6%, transparent 7%), radial-gradient(circle at 32% 51.5%, currentColor 6.5%, transparent 7.5%),
64
+ radial-gradient(circle at 35% 54.4%, currentColor 7%, transparent 8%), radial-gradient(circle at 38% 57.5%, currentColor 7.5%, transparent 8.5%),
65
+ radial-gradient(circle at 42% 61%, currentColor 8%, transparent 9%), radial-gradient(circle at 45% 63%, currentColor 9%, transparent 10%),
66
+ radial-gradient(circle at 47% 69.8%, currentColor 5%, transparent 6%), radial-gradient(circle at 50.8% 63.8%, currentColor 5%, transparent 6%),
67
+ radial-gradient(circle at 52.5% 57%, currentColor 8%, transparent 9%), radial-gradient(circle at 55.8% 52%, currentColor 7.5%, transparent 8.5%),
68
+ radial-gradient(circle at 59% 47.5%, currentColor 7%, transparent 8%), radial-gradient(circle at 62.8% 42%, currentColor 6%, transparent 7%),
69
+ radial-gradient(circle at 66.8% 37%, currentColor 5%, transparent 6%), radial-gradient(circle at 70% 32.5%, currentColor 4.5%, transparent 5.5%),
70
+ radial-gradient(circle at 73.8% 28%, currentColor 3.9%, transparent 4.9%), radial-gradient(circle at 77.5% 23.7%, currentColor 3.4%, transparent 4.4%),
71
+ radial-gradient(circle at 81% 19.5%, currentColor 3%, transparent 4%), radial-gradient(circle at 85% 15.2%, currentColor 2.5%, transparent 3.5%);
72
+ animation: am-b-checked 0.3s;
73
+ &,
74
+ & + * {
75
+ @include theme {
76
+ color: co(main);
77
+ }
78
+ }
79
+ }
80
+
81
+ & + * {
82
+ margin-left: 0.2em;
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,107 @@
1
+ @use 'sass:math';
2
+ $sz: 'xs', 's', 'm', 'l', 'xl';
3
+
4
+ [ui-form~='@b'] {
5
+ &[ui-form~='type:date'] {
6
+ position: relative;
7
+ cursor: pointer;
8
+ min-width: 6em;
9
+ height: 2.5em;
10
+ line-height: 1.5em;
11
+ transition: all 0.5s;
12
+
13
+ // 日历
14
+ [ui-form-date] {
15
+ background:
16
+ linear-gradient(
17
+ 180deg,
18
+ transparent 6%,
19
+ currentColor 8%,
20
+ currentColor 15%,
21
+ transparent 17%,
22
+ transparent 37%,
23
+ currentColor 39%,
24
+ currentColor 45%,
25
+ transparent 47%,
26
+ transparent 88%,
27
+ currentColor 90%
28
+ )
29
+ no-repeat center / 70% 70%,
30
+ linear-gradient(90deg, currentColor 10%, transparent 11%, transparent 89%, currentColor 90%) no-repeat center 55% / 70% 58%,
31
+ linear-gradient(90deg, currentColor 23%, transparent 25%, transparent 75%, currentColor 77%) no-repeat center 16% / 30% 22%;
32
+ }
33
+
34
+ // 下拉菜单活动
35
+ &[ui-form-open~='show'],
36
+ &[ui-form~='ux:hover']:hover {
37
+ [ui-form-select] {
38
+ transform: rotate(180deg);
39
+ }
40
+ [ui-form-dropdown] {
41
+ opacity: 1;
42
+ transform: translate3d(0, 0, 0);
43
+ pointer-events: auto;
44
+ }
45
+ }
46
+
47
+ // 尺寸
48
+ $sz_base: 1.5em;
49
+ @each $s in $sz {
50
+ &[ui-form~='sz:#{$s}'] {
51
+ height: $sz_base;
52
+ }
53
+ $sz_base: $sz_base + 0.5;
54
+ }
55
+
56
+ [ui-form~='type:input'] {
57
+ width: 100%;
58
+ height: 100%;
59
+ min-width: auto;
60
+ }
61
+ }
62
+ }
63
+
64
+ // 下拉菜单
65
+ [ui-form-dropdown='@b'] {
66
+ position: absolute;
67
+ top: 100%;
68
+ @include theme {
69
+ background: co(fore);
70
+ }
71
+ left: 0;
72
+ margin-top: 0.5em;
73
+ padding: 0.5em;
74
+ border-radius: 0.25em;
75
+ box-shadow: 0 1px 0.3em 1px rgba(0, 0, 0, 0.1);
76
+ transform: translate3d(0, 1rem, 0);
77
+ pointer-events: none;
78
+ opacity: 0;
79
+ transition: all 0.35s;
80
+ z-index: 1;
81
+
82
+ &::before {
83
+ content: '';
84
+ position: absolute;
85
+ width: 100%;
86
+ left: 0;
87
+ height: 1em;
88
+ bottom: 100%;
89
+ }
90
+
91
+ &::after {
92
+ content: '';
93
+ position: absolute;
94
+ box-sizing: content-box;
95
+ width: 0.5em;
96
+ height: 0.5em;
97
+ @include theme {
98
+ background: co(fore);
99
+ }
100
+ top: -0.25em;
101
+ left: 50%;
102
+ margin-left: -0.25em;
103
+ transform: rotate(45deg);
104
+ box-shadow: -1px -1px 0.15em 0 rgba(0, 0, 0, 0.07);
105
+ z-index: -1;
106
+ }
107
+ }
@@ -0,0 +1,9 @@
1
+ @import './base.scss';
2
+ @import './input.scss';
3
+ @import './textarea.scss';
4
+ @import './radio.scss';
5
+ @import './checkbox.scss';
6
+ @import './switch.scss';
7
+ @import './select.scss';
8
+ @import './date.scss';
9
+ @import './upload.scss';
@@ -0,0 +1,163 @@
1
+ /**
2
+ 属性 描述
3
+ disabled 规定输入字段应该被禁用。
4
+ max 规定输入字段的最大值。
5
+ maxlength 规定输入字段的最大字符数。
6
+ min 规定输入字段的最小值。
7
+ pattern 规定通过其检查输入值的正则表达式。
8
+ readonly 规定输入字段为只读(无法修改)。
9
+ required 规定输入字段是必需的(必需填写)。
10
+ size 规定输入字段的宽度(以字符计)。
11
+ step 规定输入字段的合法数字间隔。
12
+ value 规定输入字段的默认值。
13
+ */
14
+ @use 'sass:math';
15
+ $co: 'main', 'text', 'read', 'note', 'idle', 'case', 'line', 'info', 'well', 'warn', 'risk';
16
+ $sz: 'xs', 's', 'm', 'l', 'xl';
17
+
18
+ [ui-form~='@b'] {
19
+ &[ui-form~='type:input'] {
20
+ position: relative;
21
+ min-width: 6em;
22
+ height: 100%;
23
+ height: 2.5em;
24
+ line-height: 1.5em;
25
+ padding: 0.5em 0;
26
+ transition: all 0.5s;
27
+ @include theme {
28
+ box-shadow: inset 0 -1px 0 0 co(case);
29
+ }
30
+
31
+ display: inline-flex;
32
+ justify-content: space-between;
33
+ align-items: center;
34
+
35
+ & > * {
36
+ position: relative;
37
+ }
38
+
39
+ &:hover {
40
+ @include theme {
41
+ box-shadow: inset 0 -1px 0 0 rgba(co(main), 0.5);
42
+ }
43
+ }
44
+
45
+ &.form-focus,
46
+ &:focus-within {
47
+ @include theme {
48
+ background-color: co(fore);
49
+ box-shadow:
50
+ inset 0 -1px 0 0 rgba(co(main), 0.5),
51
+ 0 2px 0 0 rgba(co(main), 0.15);
52
+ }
53
+ }
54
+
55
+ input {
56
+ flex-shrink: 1;
57
+ flex-grow: 1;
58
+ // 未知原因如果不设宽度会把 ui-form-subffix 挤出框外
59
+ width: 100%;
60
+ height: 100%;
61
+ // padding: 0 0.25em;
62
+ border: 0;
63
+ background-color: transparent;
64
+ white-space: nowrap;
65
+ text-overflow: ellipsis;
66
+ overflow: hidden;
67
+
68
+ // 清除数字箭头
69
+ &[type='number'] {
70
+ // 火狐内核
71
+ appearance: textfield;
72
+ // 谷歌内核
73
+ &::-webkit-inner-spin-button,
74
+ &::-webkit-outer-spin-button {
75
+ appearance: none;
76
+ margin: 0;
77
+ }
78
+ }
79
+
80
+ &:-webkit-autofill {
81
+ @include theme {
82
+ box-shadow: 0 0 0 1000px co(fore) inset;
83
+ color: co(read);
84
+ -webkit-text-fill-color: co(read);
85
+ }
86
+ }
87
+
88
+ &::-webkit-input-placeholder {
89
+ @include theme {
90
+ color: rgba(co(read), 0.5);
91
+ }
92
+ }
93
+ }
94
+
95
+ // 禁用
96
+ &[ui-form~='disabled'] {
97
+ cursor: not-allowed;
98
+ opacity: 0.5;
99
+ }
100
+
101
+ // 撑满
102
+ &[ui-form~=':block'] {
103
+ width: 100%;
104
+ flex-grow: 1;
105
+ flex-shrink: 1;
106
+ }
107
+
108
+ // 圆弧
109
+ &[ui-form~=':round'] {
110
+ border-radius: 50em;
111
+ }
112
+
113
+ // 颜色
114
+ @each $c in $co {
115
+ &[ui-form~='co:#{$c}'] {
116
+ @include theme {
117
+ color: mix(co($c), co(text), 85%);
118
+ box-shadow:
119
+ inset 0 -1px 0 0 rgba(co($c), 0.6),
120
+ 0 2px 0 0 rgba(co($c), 0.15) !important;
121
+ // background-color: rgba(co($c), 0.03);
122
+ }
123
+ }
124
+
125
+ &[ui-form~='co:hover:#{$c}'] {
126
+ &:hover {
127
+ @include theme {
128
+ color: mix(co($c), co(text), 85%);
129
+ box-shadow:
130
+ inset 0 -1px 0 0 rgba(co($c), 0.6),
131
+ 0 2px 0 0 rgba(co($c), 0.15) !important;
132
+ // background-color: rgba(co($c), 0.03);
133
+ }
134
+ }
135
+ }
136
+
137
+ &[ui-form~='co:focus:#{$c}'] {
138
+ &:focus-within {
139
+ @include theme {
140
+ color: mix(co($c), co(text), 85%);
141
+ box-shadow:
142
+ inset 0 -1px 0 0 rgba(co($c), 0.6),
143
+ 0 2px 0 0 rgba(co($c), 0.15) !important;
144
+ // background-color: rgba(co($c), 0.03);
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ // 尺寸
151
+ $sz_base: 1.5em;
152
+ @each $s in $sz {
153
+ &[ui-form~='sz:#{$s}'] {
154
+ height: $sz_base;
155
+ padding: (($sz_base - 1) * 0.25) 0;
156
+ input {
157
+ padding: (($sz_base - 1) * 0.25) 0;
158
+ }
159
+ }
160
+ $sz_base: $sz_base + 0.5;
161
+ }
162
+ }
163
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ 属性 描述
3
+ disabled 规定输入字段应该被禁用。
4
+ max 规定输入字段的最大值。
5
+ maxlength 规定输入字段的最大字符数。
6
+ min 规定输入字段的最小值。
7
+ pattern 规定通过其检查输入值的正则表达式。
8
+ readonly 规定输入字段为只读(无法修改)。
9
+ required 规定输入字段是必需的(必需填写)。
10
+ size 规定输入字段的宽度(以字符计)。
11
+ step 规定输入字段的合法数字间隔。
12
+ value 规定输入字段的默认值。
13
+ */
14
+ @use 'sass:math';
15
+ $co: 'info', 'well', 'warn', 'risk';
16
+
17
+ // 动画
18
+ @keyframes am-b-radio {
19
+ 0% {
20
+ transform: scale3d(1, 1, 1);
21
+ }
22
+ 50% {
23
+ transform: scale3d(1.1, 1.1, 1);
24
+ }
25
+ 100% {
26
+ transform: scale3d(1, 1, 1);
27
+ }
28
+ }
29
+
30
+ [ui-form~='@b'] {
31
+ // 单选框
32
+ &[ui-form~='type:radio'] {
33
+ position: relative;
34
+ display: inline-flex;
35
+ align-items: center;
36
+ align-content: center;
37
+ flex-wrap: nowrap;
38
+
39
+ &[ui-form~='lt'] {
40
+ align-items: baseline;
41
+ [type='radio'] {
42
+ position: relative;
43
+ top: 0.15em;
44
+ }
45
+ }
46
+
47
+ &[ui-form~=':block'] {
48
+ display: flex;
49
+ }
50
+
51
+ [type='radio'] {
52
+ appearance: none;
53
+ font-size: inherit;
54
+ width: 1em;
55
+ height: 1em;
56
+ border: 0;
57
+ margin: 0;
58
+ padding: 0;
59
+ background: transparent;
60
+ box-shadow: inset 0 0 0 1px currentColor;
61
+ border-radius: 50%;
62
+ flex-shrink: 0;
63
+
64
+ &:checked {
65
+ background: radial-gradient(circle at 23% 43.3%, currentColor 5%, transparent 6%), radial-gradient(circle at 26% 46%, currentColor 5.5%, transparent 6.5%),
66
+ radial-gradient(circle at 29% 49%, currentColor 6%, transparent 7%), radial-gradient(circle at 32% 51.5%, currentColor 6.5%, transparent 7.5%),
67
+ radial-gradient(circle at 35% 54.4%, currentColor 7%, transparent 8%), radial-gradient(circle at 38% 57.5%, currentColor 7.5%, transparent 8.5%),
68
+ radial-gradient(circle at 42% 61%, currentColor 8%, transparent 9%), radial-gradient(circle at 45% 63%, currentColor 9%, transparent 10%),
69
+ radial-gradient(circle at 47% 69.8%, currentColor 5%, transparent 6%), radial-gradient(circle at 50.8% 63.8%, currentColor 5%, transparent 6%),
70
+ radial-gradient(circle at 52.5% 57%, currentColor 8%, transparent 9%), radial-gradient(circle at 55.8% 52%, currentColor 7.5%, transparent 8.5%),
71
+ radial-gradient(circle at 59% 47.5%, currentColor 7%, transparent 8%), radial-gradient(circle at 62.8% 42%, currentColor 6%, transparent 7%),
72
+ radial-gradient(circle at 66.8% 37%, currentColor 5%, transparent 6%), radial-gradient(circle at 70% 32.5%, currentColor 4.5%, transparent 5.5%),
73
+ radial-gradient(circle at 73.8% 28%, currentColor 3.9%, transparent 4.9%), radial-gradient(circle at 77.5% 23.7%, currentColor 3.4%, transparent 4.4%),
74
+ radial-gradient(circle at 81% 19.5%, currentColor 3%, transparent 4%), radial-gradient(circle at 85% 15.2%, currentColor 2.5%, transparent 3.5%);
75
+ box-shadow: inset 0 0 0 1px currentColor;
76
+ animation: am-b-radio 0.3s;
77
+ &,
78
+ & + * {
79
+ @include theme {
80
+ color: co(main);
81
+ }
82
+ }
83
+ }
84
+
85
+ & + * {
86
+ margin-left: 0.2em;
87
+ }
88
+ }
89
+ }
90
+ }