@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,125 @@
1
+ @use 'sass:math';
2
+ $sz: 'xs', 's', 'm', 'l', 'xl';
3
+
4
+ [ui-form~='@c'] {
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-dropdown] {
36
+ position: absolute;
37
+ top: 100%;
38
+ @include theme {
39
+ background: co(fore);
40
+ }
41
+ min-width: 100%;
42
+ max-height: 20rem;
43
+ left: 0;
44
+ margin-top: 0.5em;
45
+ padding: 0.5em;
46
+ border-radius: 0.25em;
47
+ box-shadow: 0 1px 0.3em 1px rgba(0, 0, 0, 0.1);
48
+ transform: translate3d(0, 1rem, 0);
49
+ pointer-events: none;
50
+ opacity: 0;
51
+ transition: all 0.35s;
52
+ z-index: 1;
53
+
54
+ &::before {
55
+ content: '';
56
+ position: absolute;
57
+ width: 100%;
58
+ left: 0;
59
+ height: 1em;
60
+ bottom: 100%;
61
+ }
62
+
63
+ &::after {
64
+ content: '';
65
+ position: absolute;
66
+ box-sizing: content-box;
67
+ width: 0.5em;
68
+ height: 0.5em;
69
+ @include theme {
70
+ background: co(fore);
71
+ }
72
+ top: -0.25em;
73
+ left: 50%;
74
+ margin-left: -0.25em;
75
+ transform: rotate(45deg);
76
+ box-shadow: -1px -1px 0.15em 0 rgba(0, 0, 0, 0.07);
77
+ z-index: -1;
78
+ }
79
+
80
+ // &[ui-form-dropdown~='show'] {
81
+ // opacity: 1;
82
+ // transform: translate3d(0, 0, 0);
83
+ // pointer-events: auto;
84
+ // }
85
+
86
+ & > * {
87
+ padding: 0.5em;
88
+ transition: all 0.35s;
89
+ border-radius: 0.2em;
90
+ &:hover {
91
+ @include theme {
92
+ background: co(weak);
93
+ }
94
+ }
95
+ }
96
+ }
97
+ // 下拉菜单活动
98
+ &[ui-form-open~='show'],
99
+ &[ui-form~='ux:hover']:hover {
100
+ [ui-form-select] {
101
+ transform: rotate(180deg);
102
+ }
103
+ [ui-form-dropdown] {
104
+ opacity: 1;
105
+ transform: translate3d(0, 0, 0);
106
+ pointer-events: auto;
107
+ }
108
+ }
109
+
110
+ // 尺寸
111
+ $sz_base: 1.5em;
112
+ @each $s in $sz {
113
+ &[ui-form~='sz:#{$s}'] {
114
+ height: $sz_base;
115
+ }
116
+ $sz_base: $sz_base + 0.5;
117
+ }
118
+
119
+ [ui-form~='type:input'] {
120
+ width: 100%;
121
+ height: 100%;
122
+ min-width: auto;
123
+ }
124
+ }
125
+ }
@@ -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,169 @@
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~='@c'] {
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;
26
+ border-radius: 0.25em;
27
+ transition: all 0.5s;
28
+ @include theme {
29
+ box-shadow: inset 0 0 0 1px co(case);
30
+ background-color: mix(co(weak), co(fore), 50%);
31
+ }
32
+
33
+ display: inline-flex;
34
+ justify-content: space-between;
35
+ align-items: center;
36
+
37
+ & > * {
38
+ position: relative;
39
+ }
40
+
41
+ &:hover {
42
+ @include theme {
43
+ box-shadow: inset 0 0 0 1px rgba(co(main), 0.5);
44
+ }
45
+ }
46
+
47
+ &.form-focus,
48
+ &:focus-within {
49
+ @include theme {
50
+ background-color: mix(co(weak), co(fore), 50%);
51
+ box-shadow:
52
+ inset 0 0 0 1px rgba(co(main), 0.5),
53
+ 0 0 0 2px rgba(co(main), 0.15);
54
+ }
55
+ }
56
+
57
+ input {
58
+ flex-shrink: 1;
59
+ flex-grow: 1;
60
+ // 未知原因如果不设宽度会把 ui-form-subffix 挤出框外
61
+ width: 100%;
62
+ height: 100%;
63
+ padding: 0 0.25em;
64
+ border: 0;
65
+ background-color: transparent;
66
+
67
+ // 清除数字箭头
68
+ &[type='number'] {
69
+ // 火狐内核
70
+ appearance: textfield;
71
+ // 谷歌内核
72
+ &::-webkit-inner-spin-button,
73
+ &::-webkit-outer-spin-button {
74
+ appearance: none;
75
+ margin: 0;
76
+ }
77
+ }
78
+
79
+ &:-webkit-autofill {
80
+ @include theme {
81
+ box-shadow: 0 0 0 1000px mix(co(weak), co(fore), 50%) inset;
82
+ color: co(read);
83
+ -webkit-text-fill-color: co(read);
84
+ }
85
+ }
86
+
87
+ &::-webkit-input-placeholder {
88
+ @include theme {
89
+ color: rgba(co(read), 0.5);
90
+ }
91
+ }
92
+ }
93
+
94
+ // 禁用
95
+ &[ui-form~='disabled'] {
96
+ cursor: not-allowed;
97
+ opacity: 0.5;
98
+ }
99
+
100
+ // 撑满
101
+ &[ui-form~=':block'] {
102
+ width: 100%;
103
+ flex-grow: 1;
104
+ flex-shrink: 1;
105
+ }
106
+
107
+ // 圆弧
108
+ &[ui-form~=':round'] {
109
+ border-radius: 50em;
110
+ }
111
+
112
+ // 颜色
113
+ @each $c in $co {
114
+ &[ui-form~='co:#{$c}'] {
115
+ @include theme {
116
+ color: mix(co($c), co(text), 85%);
117
+ box-shadow:
118
+ inset 0 0 0 1px rgba(co($c), 0.6),
119
+ 0 0 0 2px rgba(co($c), 0.15) !important;
120
+ background-color: rgba(co($c), 0.03);
121
+ }
122
+ }
123
+
124
+ &[ui-form~='co:hover:#{$c}'] {
125
+ &:hover {
126
+ @include theme {
127
+ color: mix(co($c), co(text), 85%);
128
+ box-shadow:
129
+ inset 0 0 0 1px rgba(co($c), 0.6),
130
+ 0 0 0 2px rgba(co($c), 0.15) !important;
131
+ background-color: rgba(co($c), 0.03);
132
+ }
133
+ }
134
+ }
135
+
136
+ &[ui-form~='co:focus:#{$c}'] {
137
+ &:focus-within {
138
+ @include theme {
139
+ color: mix(co($c), co(text), 85%);
140
+ box-shadow:
141
+ inset 0 0 0 1px rgba(co($c), 0.6),
142
+ 0 0 0 2px rgba(co($c), 0.15) !important;
143
+ background-color: rgba(co($c), 0.03);
144
+ }
145
+ }
146
+ }
147
+ }
148
+
149
+ // 尺寸
150
+ $sz_base: 1.5em;
151
+ @each $s in $sz {
152
+ &[ui-form~='sz:#{$s}'] {
153
+ height: $sz_base;
154
+ padding: (($sz_base - 1) * 0.25);
155
+ input {
156
+ padding: (($sz_base - 1) * 0.25) 0.25em;
157
+ }
158
+ }
159
+ $sz_base: $sz_base + 0.5;
160
+ }
161
+
162
+ // 搜索
163
+ [ui-form-search] {
164
+ background: radial-gradient(circle at 47% 45%, transparent 40%, currentColor 43%, currentColor 53%, transparent 56%),
165
+ radial-gradient(circle at 78% 78%, currentColor 5%, rgba(0, 0, 0, 0) 6%), radial-gradient(circle at 82% 82%, currentColor 5%, rgba(0, 0, 0, 0) 6%),
166
+ radial-gradient(circle at 85% 85%, currentColor 5%, rgba(0, 0, 0, 0) 6%);
167
+ }
168
+ }
169
+ }
@@ -0,0 +1,84 @@
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-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~='@c'] {
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
+ @include theme {
64
+ background-color: mix(co(weak), co(fore), 50%);
65
+ }
66
+
67
+ &:checked {
68
+ background-image: radial-gradient(circle at 50% 50%, currentColor 38%, transparent 40%);
69
+ box-shadow: inset 0 0 0 1px currentColor;
70
+ animation: am-radio 0.3s;
71
+ &,
72
+ & + * {
73
+ @include theme {
74
+ color: co(main);
75
+ }
76
+ }
77
+ }
78
+
79
+ & + * {
80
+ margin-left: 0.2em;
81
+ }
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,121 @@
1
+ @use 'sass:math';
2
+ $sz: 'xs', 's', 'm', 'l', 'xl';
3
+
4
+ [ui-form~='@c'] {
5
+ &[ui-form~='type:select'] {
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-select] {
15
+ width: 0.8em;
16
+ height: 0.8em;
17
+ display: inline-block;
18
+ border-radius: 35%;
19
+ @include theme {
20
+ color: co(note);
21
+ }
22
+ background:
23
+ linear-gradient(45deg, transparent 51%, currentColor 52%, currentColor 67%, transparent 68%) no-repeat 23.5% 65% / 35% 50%,
24
+ linear-gradient(-45deg, transparent 51%, currentColor 52%, currentColor 67%, transparent 68%) no-repeat 76.5% 65% / 35% 50%;
25
+ }
26
+
27
+ // 下拉菜单
28
+ [ui-form-dropdown] {
29
+ position: absolute;
30
+ top: 100%;
31
+ @include theme {
32
+ background: co(fore);
33
+ }
34
+ min-width: 100%;
35
+ max-height: 20rem;
36
+ left: 0;
37
+ margin-top: 0.5em;
38
+ padding: 0.5em;
39
+ border-radius: 0.25em;
40
+ box-shadow: 0 1px 0.3em 1px rgba(0, 0, 0, 0.1);
41
+ transform: translate3d(0, 1rem, 0);
42
+ pointer-events: none;
43
+ opacity: 0;
44
+ transition: all 0.35s;
45
+ z-index: 1;
46
+
47
+ &::before {
48
+ content: '';
49
+ position: absolute;
50
+ width: 100%;
51
+ left: 0;
52
+ height: 1em;
53
+ bottom: 100%;
54
+ }
55
+
56
+ &::after {
57
+ content: '';
58
+ position: absolute;
59
+ box-sizing: content-box;
60
+ width: 0.5em;
61
+ height: 0.5em;
62
+ @include theme {
63
+ background: co(fore);
64
+ }
65
+ top: -0.25em;
66
+ left: 50%;
67
+ margin-left: -0.25em;
68
+ transform: rotate(45deg);
69
+ box-shadow: -1px -1px 0.15em 0 rgba(0, 0, 0, 0.07);
70
+ z-index: -1;
71
+ }
72
+
73
+ // &[ui-form-dropdown~='show'] {
74
+ // opacity: 1;
75
+ // transform: translate3d(0, 0, 0);
76
+ // pointer-events: auto;
77
+ // }
78
+
79
+ & > * {
80
+ padding: 0.5em;
81
+ transition: all 0.35s;
82
+ border-radius: 0.2em;
83
+ &:hover {
84
+ @include theme {
85
+ background: co(weak);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ // 下拉菜单活动
91
+ &[ui-form-open~='show'],
92
+ &[ui-form~='ux:hover']:hover {
93
+ [ui-form-select],
94
+ .icon.icon-dropdown {
95
+ transform: rotate(180deg);
96
+ }
97
+ [ui-form-dropdown] {
98
+ opacity: 1;
99
+ transform: translate3d(0, 0, 0);
100
+ pointer-events: auto;
101
+ }
102
+ }
103
+
104
+ // 尺寸
105
+ $sz_base: 1.5em;
106
+ @each $s in $sz {
107
+ &[ui-form~='sz:#{$s}'] {
108
+ height: $sz_base;
109
+ }
110
+ $sz_base: $sz_base + 0.5;
111
+ }
112
+
113
+ & > *,
114
+ [ui-form~='type:input'] {
115
+ width: 100%;
116
+ height: 100%;
117
+ min-width: auto;
118
+ vertical-align: middle;
119
+ }
120
+ }
121
+ }
@@ -0,0 +1,83 @@
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-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
+ // 复选框
30
+ [ui-form~='@c'] {
31
+ &[ui-form~='type:switch'] {
32
+ position: relative;
33
+ display: inline-flex;
34
+ align-items: baseline;
35
+ flex-wrap: nowrap;
36
+
37
+ &[ui-form~=':block'] {
38
+ display: flex;
39
+ }
40
+
41
+ [type='checkbox'] {
42
+ appearance: none;
43
+ font-size: inherit;
44
+ width: 1.5em;
45
+ height: 1em;
46
+ border: 0;
47
+ margin: 0;
48
+ padding: 0;
49
+ background: transparent;
50
+ box-shadow: inset 0 0 0 1px currentColor;
51
+ border-radius: 10em;
52
+ flex-shrink: 0;
53
+ position: relative;
54
+ top: 0.15em;
55
+ @include theme {
56
+ background-color: mix(co(weak), co(fore), 50%);
57
+ }
58
+ background-image: radial-gradient(circle at 50% 50%, currentColor 28%, transparent 30%);
59
+ background-position-x: -0.2em;
60
+ transition:
61
+ all 0.3s,
62
+ background-position-x ease-out 0.3s;
63
+
64
+ &:checked {
65
+ @include theme {
66
+ background-color: co(main);
67
+ background-image: radial-gradient(circle at 50% 50%, co(fore) 28%, transparent 30%);
68
+ }
69
+ background-position-x: 0.2em;
70
+ &,
71
+ & + * {
72
+ @include theme {
73
+ color: co(main);
74
+ }
75
+ }
76
+ }
77
+
78
+ & + * {
79
+ margin-left: 0.2em;
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,85 @@
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
+ [ui-form~='@c'] {
18
+ &[ui-form~='type:textarea'] {
19
+ position: relative;
20
+ min-width: 6em;
21
+ line-height: 1.5em;
22
+ padding: 0.5em;
23
+ border-radius: 0.25em;
24
+ transition: all 0.5s;
25
+ background-color: transparent;
26
+
27
+ @include theme {
28
+ box-shadow: inset 0 0 0 1px co(case);
29
+ background-color: mix(co(weak), co(fore), 50%);
30
+ }
31
+
32
+ &:hover {
33
+ @include theme {
34
+ box-shadow: inset 0 0 0 1px rgba(co(main), 0.5);
35
+ }
36
+ }
37
+
38
+ &.form-focus,
39
+ &:focus {
40
+ background-color: transparent;
41
+ @include theme {
42
+ box-shadow:
43
+ inset 0 0 0 1px rgba(co(main), 0.5),
44
+ 0 0 0 2px rgba(co(main), 0.15);
45
+ }
46
+ }
47
+
48
+ // 颜色
49
+ @each $c in $co {
50
+ &[ui-form~='co:#{$c}'] {
51
+ @include theme {
52
+ color: mix(co($c), co(text), 85%);
53
+ box-shadow:
54
+ inset 0 0 0 1px rgba(co($c), 0.6),
55
+ 0 0 0 2px rgba(co($c), 0.15) !important;
56
+ background-color: rgba(co($c), 0.035);
57
+ }
58
+ }
59
+
60
+ &[ui-form~='co:hover:#{$c}'] {
61
+ &:hover {
62
+ @include theme {
63
+ color: mix(co($c), co(text), 85%);
64
+ box-shadow:
65
+ inset 0 0 0 1px rgba(co($c), 0.6),
66
+ 0 0 0 2px rgba(co($c), 0.15) !important;
67
+ background-color: rgba(co($c), 0.035);
68
+ }
69
+ }
70
+ }
71
+
72
+ &[ui-form~='co:focus:#{$c}'] {
73
+ &:focus-within {
74
+ @include theme {
75
+ color: mix(co($c), co(text), 85%);
76
+ box-shadow:
77
+ inset 0 0 0 1px rgba(co($c), 0.6),
78
+ 0 0 0 2px rgba(co($c), 0.15) !important;
79
+ background-color: rgba(co($c), 0.035);
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }