@neatui/css 3.15.0 → 3.16.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,281 @@
1
+ @use 'sass:list';
2
+ @use 'sass:string';
3
+
4
+ // ============================================
5
+ // NeatUI Container Queries (可选模块)
6
+ // 使用: @import '@neatui/css/core/container';
7
+ // ============================================
8
+
9
+ // 容器查询断点 (纯尺寸命名,不涉及设备语义)
10
+ // s = small, m = medium, l = large
11
+ // ss/sm/sl = 小尺寸段
12
+ // ms/mm/ml = 中尺寸段
13
+ // ls/lm/ll = 大尺寸段
14
+ $clevel: (
15
+ ss: 320px,
16
+ sm: 480px,
17
+ sl: 640px,
18
+ ms: 800px,
19
+ mm: 960px,
20
+ ml: 1120px,
21
+ ls: 1280px,
22
+ lm: 1440px,
23
+ ll: 1600px
24
+ );
25
+
26
+ // ============================================
27
+ // 定义容器
28
+ // ============================================
29
+ [ui-container] {
30
+ container-type: inline-size;
31
+ }
32
+
33
+ // ============================================
34
+ // 容器查询 Mixins
35
+ // ============================================
36
+
37
+ // 小尺寸段 (< 800px)
38
+ @mixin cs() {
39
+ $this: #{list.nth(&, 1)};
40
+ @container (max-width: 799px) {
41
+ @if ($this == '') {
42
+ @content;
43
+ } @else {
44
+ & {
45
+ @content;
46
+ }
47
+ }
48
+ }
49
+ }
50
+
51
+ // 中尺寸段 (800px - 1279px)
52
+ @mixin cm() {
53
+ $this: #{list.nth(&, 1)};
54
+ @container (min-width: 800px) and (max-width: 1279px) {
55
+ @if ($this == '') {
56
+ @content;
57
+ } @else {
58
+ & {
59
+ @content;
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ // 大尺寸段 (>= 1280px)
66
+ @mixin cl() {
67
+ $this: #{list.nth(&, 1)};
68
+ @container (min-width: 1280px) {
69
+ @if ($this == '') {
70
+ @content;
71
+ } @else {
72
+ & {
73
+ @content;
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ // 容器尺寸查询
80
+ @mixin cq($p) {
81
+ $this: #{list.nth(&, 1)};
82
+ $r: string.slice($p, 1, 1);
83
+
84
+ // 大于某节点时
85
+ @if ($r == '>') {
86
+ @if ($p == '>ss') {
87
+ @container (min-width: 320px) {
88
+ @if ($this == '') { @content; } @else { & { @content; } }
89
+ }
90
+ } @else if ($p == '>sm') {
91
+ @container (min-width: 480px) {
92
+ @if ($this == '') { @content; } @else { & { @content; } }
93
+ }
94
+ } @else if ($p == '>sl') {
95
+ @container (min-width: 640px) {
96
+ @if ($this == '') { @content; } @else { & { @content; } }
97
+ }
98
+ } @else if ($p == '>ms') {
99
+ @container (min-width: 800px) {
100
+ @if ($this == '') { @content; } @else { & { @content; } }
101
+ }
102
+ } @else if ($p == '>mm') {
103
+ @container (min-width: 960px) {
104
+ @if ($this == '') { @content; } @else { & { @content; } }
105
+ }
106
+ } @else if ($p == '>ml') {
107
+ @container (min-width: 1120px) {
108
+ @if ($this == '') { @content; } @else { & { @content; } }
109
+ }
110
+ } @else if ($p == '>ls') {
111
+ @container (min-width: 1280px) {
112
+ @if ($this == '') { @content; } @else { & { @content; } }
113
+ }
114
+ } @else if ($p == '>lm') {
115
+ @container (min-width: 1440px) {
116
+ @if ($this == '') { @content; } @else { & { @content; } }
117
+ }
118
+ } @else if ($p == '>ll') {
119
+ @container (min-width: 1600px) {
120
+ @if ($this == '') { @content; } @else { & { @content; } }
121
+ }
122
+ }
123
+ }
124
+ // 小于某节点时
125
+ @else if ($r == '<') {
126
+ @if ($p == '<ss') {
127
+ @container (max-width: 319px) {
128
+ @if ($this == '') { @content; } @else { & { @content; } }
129
+ }
130
+ } @else if ($p == '<sm') {
131
+ @container (max-width: 479px) {
132
+ @if ($this == '') { @content; } @else { & { @content; } }
133
+ }
134
+ } @else if ($p == '<sl') {
135
+ @container (max-width: 639px) {
136
+ @if ($this == '') { @content; } @else { & { @content; } }
137
+ }
138
+ } @else if ($p == '<ms') {
139
+ @container (max-width: 799px) {
140
+ @if ($this == '') { @content; } @else { & { @content; } }
141
+ }
142
+ } @else if ($p == '<mm') {
143
+ @container (max-width: 959px) {
144
+ @if ($this == '') { @content; } @else { & { @content; } }
145
+ }
146
+ } @else if ($p == '<ml') {
147
+ @container (max-width: 1119px) {
148
+ @if ($this == '') { @content; } @else { & { @content; } }
149
+ }
150
+ } @else if ($p == '<ls') {
151
+ @container (max-width: 1279px) {
152
+ @if ($this == '') { @content; } @else { & { @content; } }
153
+ }
154
+ } @else if ($p == '<lm') {
155
+ @container (max-width: 1439px) {
156
+ @if ($this == '') { @content; } @else { & { @content; } }
157
+ }
158
+ } @else if ($p == '<ll') {
159
+ @container (max-width: 1599px) {
160
+ @if ($this == '') { @content; } @else { & { @content; } }
161
+ }
162
+ }
163
+ }
164
+ }
165
+
166
+ // ============================================
167
+ // 容器隐藏工具类 (ui-chide)
168
+ // ============================================
169
+
170
+ // 大于某节点时隐藏
171
+ @each $sz in $clevel {
172
+ $n: #{list.nth($sz, 1)};
173
+ [ui-chide~='>#{$n}'] {
174
+ @include cq('>#{$n}') {
175
+ display: none !important;
176
+ }
177
+ }
178
+ }
179
+
180
+ // 小于某节点时隐藏
181
+ @each $sz in $clevel {
182
+ $n: #{list.nth($sz, 1)};
183
+ [ui-chide~='<#{$n}'] {
184
+ @include cq('<#{$n}') {
185
+ display: none !important;
186
+ }
187
+ }
188
+ }
189
+
190
+ // ============================================
191
+ // 容器显示工具类 (ui-cshow)
192
+ // ============================================
193
+
194
+ // 大于某节点时显示为 block
195
+ @each $sz in $clevel {
196
+ $n: #{list.nth($sz, 1)};
197
+ [ui-cshow~='>#{$n}'] {
198
+ display: none;
199
+ @include cq('>#{$n}') {
200
+ display: block !important;
201
+ }
202
+ }
203
+ [ui-cshow~='>#{$n}:flex'] {
204
+ display: none;
205
+ @include cq('>#{$n}') {
206
+ display: flex !important;
207
+ }
208
+ }
209
+ [ui-cshow~='>#{$n}:grid'] {
210
+ display: none;
211
+ @include cq('>#{$n}') {
212
+ display: grid !important;
213
+ }
214
+ }
215
+ }
216
+
217
+ // 小于某节点时显示为 block
218
+ @each $sz in $clevel {
219
+ $n: #{list.nth($sz, 1)};
220
+ [ui-cshow~='<#{$n}'] {
221
+ display: none;
222
+ @include cq('<#{$n}') {
223
+ display: block !important;
224
+ }
225
+ }
226
+ [ui-cshow~='<#{$n}:flex'] {
227
+ display: none;
228
+ @include cq('<#{$n}') {
229
+ display: flex !important;
230
+ }
231
+ }
232
+ }
233
+
234
+ // ============================================
235
+ // 容器 Flex 方向
236
+ // ============================================
237
+ @each $sz in $clevel {
238
+ $n: #{list.nth($sz, 1)};
239
+ [ui-cflex~='>#{$n}:row'] {
240
+ @include cq('>#{$n}') {
241
+ flex-direction: row !important;
242
+ }
243
+ }
244
+ [ui-cflex~='>#{$n}:col'] {
245
+ @include cq('>#{$n}') {
246
+ flex-direction: column !important;
247
+ }
248
+ }
249
+ [ui-cflex~='<#{$n}:row'] {
250
+ @include cq('<#{$n}') {
251
+ flex-direction: row !important;
252
+ }
253
+ }
254
+ [ui-cflex~='<#{$n}:col'] {
255
+ @include cq('<#{$n}') {
256
+ flex-direction: column !important;
257
+ }
258
+ }
259
+ }
260
+
261
+ // ============================================
262
+ // 容器文本对齐
263
+ // ============================================
264
+ @each $sz in $clevel {
265
+ $n: #{list.nth($sz, 1)};
266
+ [ui-ctext~='>#{$n}:left'] {
267
+ @include cq('>#{$n}') {
268
+ text-align: left !important;
269
+ }
270
+ }
271
+ [ui-ctext~='>#{$n}:center'] {
272
+ @include cq('>#{$n}') {
273
+ text-align: center !important;
274
+ }
275
+ }
276
+ [ui-ctext~='>#{$n}:right'] {
277
+ @include cq('>#{$n}') {
278
+ text-align: right !important;
279
+ }
280
+ }
281
+ }
package/core/size.scss CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
2
  * 模块:字号
3
3
  * 模块类型:b(基础模块)
4
- * 精度:9 +
5
- * 分级:3 +
6
- * 适配:桌面 | 平析 | 移动
7
- * 兼容:
8
- * 版本:v0.0.1
9
- * 备注:s->Small 小,m->Middle 中,l->Large 大;x->Extra 特大
4
+ * 精度:11档 (xs ss sm sl ms mm ml ls lm ll xl)
5
+ * 分级:3 (s/m/l)
6
+ * 适配:桌面 | 平板 | 移动
7
+ * 版本:v0.0.2
8
+ * 备注:s->Small 小,m->Middle 中,l->Large 大;x->Extra
10
9
  */
11
10
 
12
11
  @use 'sass:list';
@@ -27,7 +26,7 @@
27
26
 
28
27
  // 分级字号
29
28
  @mixin randSize($d: '') {
30
- $rank: 'xxs', 'xs', 'ss', 'sm', 'sl', 'ms', 'mm', 'ml', 'ls', 'lm', 'll', 'xl', 'xxl';
29
+ $rank: 'xs', 'ss', 'sm', 'sl', 'ms', 'mm', 'ml', 'ls', 'lm', 'll', 'xl';
31
30
  // 分级字号
32
31
  .#{$d}fs-no {
33
32
  font-size: 0rem;
@@ -36,7 +35,7 @@
36
35
  line-height: 0;
37
36
  }
38
37
 
39
- $sz: 0.6;
38
+ $sz: 0.7;
40
39
  $add: 0.05;
41
40
  @each $k in $rank {
42
41
  @if ($sz<1.2) {
package/core/trim.scss CHANGED
@@ -1,6 +1,6 @@
1
- @use './media.scss' as *;
1
+ @use "./media.scss" as *;
2
2
 
3
- @mixin trim($media: '') {
3
+ @mixin trim($media: "") {
4
4
  $size: (no, xs, ss, sm, sl, ms, mm, ml, ls, lm, ll, xl);
5
5
 
6
6
  // 栅格
@@ -56,7 +56,7 @@
56
56
  // 圆角
57
57
  $br_base: 0;
58
58
  .#{$media}r-full {
59
- border-radius: 50%;
59
+ border-radius: 10000em;
60
60
  }
61
61
  @each $sz in $size {
62
62
  // 四角
@@ -626,11 +626,11 @@
626
626
  @include trim();
627
627
 
628
628
  // 平板
629
- @include med('<dpc') {
630
- @include trim('pad\\:');
629
+ @include med("<dpc") {
630
+ @include trim("pad\\:");
631
631
  }
632
632
 
633
633
  // 移动
634
- @include med('<pad') {
635
- @include trim('mob\\:');
634
+ @include med("<pad") {
635
+ @include trim("mob\\:");
636
636
  }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@neatui/css",
3
- "version": "3.15.0",
3
+ "version": "3.16.0",
4
4
  "description": "neatui",
5
5
  "main": "./neatui.scss",
6
6
  "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "author": "xiaojunbo",
8
11
  "scripts": {
9
12
  "build": "yarn build:scss && yarn build:optimize && yarn build:minify",
package/core/README.md DELETED
@@ -1,142 +0,0 @@
1
- # @neatui/core
2
-
3
- MCUI 核心组件,MCUI 全局架构性组件。官网 [https://mcui.fekit.cn/](https://mcui.fekit.cn/)
4
-
5
- ## 安装
6
-
7
- ### 安装核心
8
-
9
- ```
10
- npm i @neatui/core
11
- ```
12
-
13
- ### 安装组件
14
-
15
- ```
16
- npm i @neatui/btns
17
- ```
18
-
19
- ## 引用
20
-
21
- ```scss
22
- // main.scss
23
-
24
- // 添加主题
25
- $theme: (
26
- light: (
27
- main: #d52932,
28
- // 主体
29
- vice: #67337d,
30
- // 辅助
31
- text: #000000,
32
- // 文本
33
- back: #ffffff,
34
- // 底色
35
- link: #0d66d0,
36
- // 链接
37
- code: #e23861,
38
- // 代码
39
- well: #4bbc73,
40
- // 提倡
41
- warn: #fb9a2a,
42
- // 警告
43
- risk: #f95850,
44
- // 风险
45
- info: #0889e4 // 信息
46
- ),
47
- dark: (
48
- main: #91cc48,
49
- vice: #ffa60f,
50
- text: rgba(255, 255, 255, 0.9),
51
- back: #262629,
52
- link: #00b9ff,
53
- code: #e23861,
54
- well: #49ca74,
55
- warn: #fb9a2a,
56
- risk: #fd7466,
57
- info: #949af9
58
- )
59
- // 添加更多主题...
60
- );
61
-
62
- // 引用框架核心
63
- @import '~@neatui/core';
64
-
65
- // 引用业务组件
66
- @import '~@neatui/btns';
67
- // 引用更多组件...
68
- ```
69
-
70
- ## 使用
71
-
72
- ### 颜色
73
-
74
- ```scss
75
- @import '~@neatui/core';
76
-
77
- .header {
78
- position: fixed;
79
- width: 100%;
80
- height: 4rem;
81
- left: 0;
82
- top: 0;
83
-
84
- @include theme {
85
- background-color: var(--co-back);
86
- color: var(--co-text);
87
- }
88
- }
89
- ```
90
-
91
- ↓
92
-
93
- ```css
94
- /* 编译成css: */
95
- .header {
96
- position: fixed;
97
- width: 100%;
98
- height: 4rem;
99
- left: 0;
100
- top: 0;
101
- }
102
- [mcui~='light'] .header {
103
- background-color: #ffffff;
104
- color: #000000;
105
- }
106
- [mcui~='dark'] .header {
107
- background-color: #262629;
108
- color: rgba(255, 255, 255, 0.9);
109
- }
110
- ```
111
-
112
- ### 响应三端
113
-
114
- ```scss
115
- @import '~@neatui/core';
116
-
117
- body {
118
- font-size: 14px;
119
-
120
- @include mob {
121
- font-size: 12px;
122
- }
123
- }
124
- ```
125
-
126
- ↓
127
-
128
- ```css
129
- /* 编译成css: */
130
- body {
131
- font-size: 14px;
132
- }
133
- @media screen and (max-width: 767px) {
134
- body {
135
- font-size: 12px;
136
- }
137
- }
138
- ```
139
-
140
- ## 更多
141
-
142
- 详细文档请到MCUI官网 [https://mcui.fekit.cn](https://mcui.fekit.cn)
package/core/package.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@neatui/core",
3
- "version": "1.12.15",
4
- "description": "MCUI 核心组件,MCUI 全局架构性组件。官网 https://mcui.fekit.cn",
5
- "main": "mcui@core.scss",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "xiaojunbo",
10
- "license": "MIT",
11
- "dependencies": {},
12
- "keywords": [
13
- "mcui",
14
- "ui"
15
- ]
16
- }