@neatui/css 5.5.0 → 5.5.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @neatui/css 更新记录
2
2
 
3
+ ## 5.5.1
4
+
5
+ - `GUIDE.md` 开头新增「规则速查」:全部可用写法与禁止清单,按编译结果核对;修正手册中不存在的写法(`text-*`、`shadow-*`、`overflow-*`、`cursor-*`、`w-screen` 等)与错误数值(`z-*`、`w-*l`),按钮必须带 `@a` / `@b` 主题标记。
6
+ - `README.md` 新增 AI 使用指引。
7
+ - token schema 新增 `ui-wrap`,`yarn validate` 与 VS Code 插件(0.2.1)可校验、补全;移除换行类补全。
8
+
3
9
  ## 5.5.0
4
10
 
5
11
  ### 不兼容变更:换行只用 `ui-wrap`
package/GUIDE.md CHANGED
@@ -1,15 +1,89 @@
1
1
  # NeatUI 完整使用手册
2
2
 
3
- > **版本**: @neatui/css v4.0.0
3
+ > **版本**: @neatui/css v5.x
4
4
  >
5
- > **更新日期**: 2026-07-28
5
+ > **更新日期**: 2026-11-02
6
6
  >
7
7
  > **定位**: 这不是又一个 CSS 工具库,而是一套完整的设计系统 + 原子化实现
8
+ >
9
+ > **AI / 新读者**:先读下方「规则速查」,按它写代码;需要细节时再查后面对应章节。
10
+
11
+ ---
12
+
13
+ ## 规则速查
14
+
15
+ 本节是确定性规则,人和 AI 都应以此为准。只使用下面列出的写法;**不在这里、也不在后续章节中的 class 或属性值,视为不存在**,不要按其他框架的习惯臆造(如 `text-center`、`shadow-md`、`overflow-hidden`、`cursor-pointer`)。
16
+
17
+ ### 1. 档位
18
+
19
+ | 名称 | 取值 |
20
+ | --- | --- |
21
+ | 尺寸档 `{size}` | `no xs ss sm sl ms mm ml ls lm ll xl`(12 档,由小到大) |
22
+ | 宽高 / 圆角 / 字号分段 | 在档位后加 `*s` / `*m` / `*l`,如 `w-xl*s`、`fs-mm*s`、`r-sm*m`(`no`、`full` 无分段) |
23
+ | 层级 / 透明度档 | `no xs ss sm sl ms mm ml ls lm ll xl xx`(13 档) |
24
+ | 断点 | `mob` <800px,`pad` 800–1279px,`dpc` ≥1280px;细分 `mob-s/m/l`、`pad-s/m/l`、`dpc-s/m/l`,分界 480 / 640 / 800 / 960 / 1120 / 1280 / 1440 / 1600px |
25
+
26
+ ### 2. 原子 class
27
+
28
+ | 用途 | 写法 |
29
+ | --- | --- |
30
+ | 内边距 | `n-` `nx-` `ny-` `nt-` `nr-` `nb-` `nl-` + `{size}`;加 `-sub` 作用于直接子元素,`-sun` 作用于孙级 |
31
+ | 外边距 | `m-` `mx-` `my-` `mt-` `mr-` `mb-` `ml-` + `{size}`,同样支持 `-sub` / `-sun`;负值 `-m-sm`、`-mt-sm`(无 `-sub`) |
32
+ | 间隙 | `gap-{size}`(Flex 与 Grid 共用) |
33
+ | 宽高 | `w-` `h-` `min-w-` `max-w-` `min-h-` `max-h-` + `{size}` / 分段;`w-full` `h-full` `full` `w-auto` `h-auto` |
34
+ | 圆角 | `r-{size}`、`r-full`;方向 `r-t-` `r-b-` `r-lt-` `r-rt-` `r-lb-` `r-rb-` |
35
+ | 字号 | `fs-{size}` / 分段;语义 `fs-case` `fs-note` `fs-desc` `fs-body` `fs-lead`;`fs-root` `fs++` `fs--` |
36
+ | 字重 | `bold`、`fw1`…`fw9`(=100…900)、`fw0`(normal) |
37
+ | 行高 | `lh-{size}`(无 `lh-sl`) |
38
+ | 文字对齐 | `al` `ac` `ar` `aj`(左 / 中 / 右 / 两端);`-sub` 作用于子元素 |
39
+ | 垂直对齐 | `vt` `vm` `vb` |
40
+ | 大小写 | `upper` `lower` |
41
+ | 显示 | `block` `inline` `inline-block`(`dib`) `flex` `inline-flex` `none`(隐藏);`hide` 只设 `opacity:0` 保留占位;均有 `-sub` |
42
+ | 定位 | `pr` `pa` `pf` `ps`;偏移 `ot-` `or-` `ob-` `ol-` + `{size}` |
43
+ | 层级 | `z-{层级档}`(`z-no`=0 … `z-xx`=12) |
44
+ | 透明度 | `o-{层级档}`(`o-no`=0 … `o-mm`=.5 … `o-xx`=1) |
45
+ | 滚动 | `scroll` `scroll-x` `scroll-y`,或属性 `ui-scroll` |
46
+ | Flex 子项 | `flex-block`(flex:1 且裁切) `flex-fill`(flex:1 不裁切) `flex-grow` `flex-shrink` `flex-fixed` |
47
+ | 边框 | 宽度 `b-` `bt-` `br-` `bb-` `bl-` `bx-` `by-` + `{size}`;样式 `b-solid` `b-dashed` `b-double` `b-dotted` `b-no` |
48
+ | 颜色 | `co-` 文字、`bg-` 背景、`b-` 边框 + 颜色名;派生 `-o-` / `-w-` / `-b-` + `xxs…xxl`,如 `bg-main-o-sm` |
49
+ | 颜色名 | 种子 `main text fore back link code well warn risk`;自动 `read desc note case line weak deep none`;绝对色 `w`(白) `b`(黑);项目可扩展 |
50
+ | 状态 | 只有 `:hover` 与 `:active` 后缀,如 `co-main:hover`、`bg-main-b-sm:active`(颜色、`z-`、`o-`);**没有** `:focus` / `:disabled` |
51
+ | 交互 | `ux-hover` `ux-shadow` `ux-click` `ux-scale` `ux-disable` `ux-none`;`ev-none` / `ev-auto`(pointer-events) |
52
+ | 容器 | `doc`(正文宽度,最大 800px);`box` `box-base` `box-norm` `box-slim` `box-wide` `box-full` |
53
+
54
+ 响应式:上表除颜色、状态、交互、边框样式、`z-`、`o-` 外,class 都可加 `pad:`(≤1279px)或 `mob:`(≤799px)前缀,层叠顺序 `基础 → pad: → mob:`。**没有 `dpc:` class 前缀。**
55
+
56
+ ### 3. 属性语法
57
+
58
+ | 属性 | 语法 | 示例 |
59
+ | --- | --- | --- |
60
+ | `ui-flex` | `{row\|col} {x}{y}` + 可选 `wrap` `reverse` `inline` `block` `fixed`;x:`l c r x a`,y:`t m b y d`;可加 `pad:` `mob:` | `ui-flex="row xm"`、`ui-flex="col cm mob:row"` |
61
+ | `ui-grid` | 列数 `1..12` + 九宫格对齐 + `block`;`mob:` `pad:` `dpc:` 前缀;间距用 `gap-*` class | `ui-grid="mob:1 pad:2 dpc:4" class="gap-mm"` |
62
+ | `ui-row` / `ui-col` | `{断点}-{0..24}`,断点为 `mob pad dpc` 及细分;`ui-row` 另有 `space` `:full` `reverse` | `ui-row="space" ui-col="mob-24 dpc-8"` |
63
+ | `ui-hide` | `>` `<` `=` + 断点或细分档,可空格组合,命中即隐藏 | `ui-hide="<pad"`、`ui-hide="=mob =dpc-l"` |
64
+ | `ui-wrap` | `no`(不换行)、`all`(全部换行)、或同 `ui-hide` 的断点值(列出的范围换行,其余不换行) | `ui-wrap="no"`、`ui-wrap="=mob"` |
65
+ | `ui-omit` | `1..9` 行省略 | `ui-omit="2"` |
66
+ | `ui-cover` | 13 种比例或 `+{size}` / `-{size}`,可加 `cover` / `contain` | `ui-cover="16:9"` |
67
+ | `ui-fit` | `cover contain fill none down` + 可选九宫格锚点 | `ui-fit="cover lt"` |
68
+ | `ui-scroll` | `:x` `:y` `:hidden` `x:hidden` `y:hidden` `x:unset` `y:unset` `stable`,尺寸 `xs s m l xl` | `ui-scroll=":x :y"` |
69
+ | `ui-btn` | 主题 `@a` / `@b`(必填) + 颜色名 + 尺寸 `xs s m l xl` + 修饰 `:round` `:border` `:square` `:underline`(文字按钮) `:block`(100% 宽) `:disabled` | `ui-btn="@a main s :border"` |
70
+
71
+ ### 4. 禁止清单
72
+
73
+ - 不写任意像素或色值(`style="padding:13px"`、`color:#f00`);用档位和语义色。确需特殊值时手写样式并注释原因。
74
+ - 不用其他框架的类名:`text-center`→`ac`,`font-bold`→`bold`,`hidden`→`none`,没有 `overflow-*`(滚动用 `scroll` / `scroll-x` / `scroll-y` 或 `ui-scroll`),`shadow-*` / `cursor-*` / `w-screen` / `h-screen` 不存在。
75
+ - 换行只用 `ui-wrap`;`wrap` / `nowrap` 类已移除;不要写 `ui-wrap=""`,用 `ui-wrap="no"`。`flex-wrap` / `flex-nowrap` 是 flex 换行,与文字换行无关。
76
+ - 不写 `dpc:` class 前缀;桌面值写在无前缀的基础 class 上。
77
+ - 组件属性必须带主题标记,否则没有样式:`ui-btn` `ui-btns` `ui-card` `ui-tag` `ui-tabs` `ui-form` `ui-img` `ui-avatar` `ui-note` `ui-list` `ui-line` `ui-steps` `ui-title` `ui-navs` 等写 `@a`(部分组件另有 `@b` `@c`…),如 `ui-tag="@a main"`。布局属性(`ui-flex` `ui-grid` `ui-row` `ui-hide` `ui-wrap` `ui-scroll` `ui-cover` `ui-fit` `ui-omit`)不需要。
78
+ - 不手写 `@media`;用 class 前缀、`ui-hide`、`ui-wrap` 或 SCSS mixin(`neatui.mob` / `neatui.pad` / `neatui.dpc`)。
79
+ - 有色深背景上的白字用 `co-w`,不用 `co-fore` / `co-text`。
80
+ - `ui-hide` 只改可见性,不卸载组件;需要销毁时用 `v-if`。
8
81
 
9
82
  ---
10
83
 
11
84
  ## 目录
12
85
 
86
+ - [规则速查](#规则速查)
13
87
  - [核心理念](#核心理念)
14
88
  - [架构概览](#架构概览)
15
89
  - [快速开始](#快速开始)
@@ -126,7 +200,7 @@ npm install @neatui/css @neatui/vue
126
200
  </div>
127
201
 
128
202
  <!-- NeatUI 方式 -->
129
- <div ui-flex="row cm" class="n-sm bg-fore r-sm shadow-sm">
203
+ <div ui-flex="row cm" class="n-sm bg-fore r-sm">
130
204
  <h1 class="fs-lm bold co-text">Hello World</h1>
131
205
  </div>
132
206
  ```
@@ -596,7 +670,7 @@ y: 纵向对齐
596
670
  </nav>
597
671
 
598
672
  <!-- 垂直两端分布 + 水平居中 -->
599
- <div ui-flex="col yc">
673
+ <div ui-flex="col cy">
600
674
  <header>顶部</header>
601
675
  <footer>底部</footer>
602
676
  </div>
@@ -627,7 +701,7 @@ y: 纵向对齐
627
701
  </div>
628
702
 
629
703
  <!-- NeatUI -->
630
- <div ui-flex="row cm" class="h-screen">
704
+ <div ui-flex="row cm" class="h-full"> <!-- 父级需有确定高度 -->
631
705
  <div class="bg-fore n-ml">内容</div>
632
706
  </div>
633
707
  ```
@@ -643,11 +717,11 @@ y: 纵向对齐
643
717
 
644
718
  <!-- NeatUI -->
645
719
  <div ui-flex="col cm" class="n-sm">
646
- <div ui-img="sz:sl :round">
720
+ <div ui-img="@a sz:sl :round">
647
721
  <img />
648
722
  </div>
649
723
  <h3 class="mt-ss">标题</h3>
650
- <button class="mt-ms" ui-btn="main">按钮</button>
724
+ <button class="mt-ms" ui-btn="@a main">按钮</button>
651
725
  </div>
652
726
  ```
653
727
 
@@ -713,7 +787,7 @@ grade: gap class 的间距等级 (no, xs, ss, sm, sl, ms, mm, ml, ls, lm, ll, xl
713
787
  <img :src="product.image" />
714
788
  <h3 class="co-main fs-ml">{{ product.name }}</h3>
715
789
  <p class="co-desc">{{ product.desc }}</p>
716
- <button ui-btn="main s">购买</button>
790
+ <button ui-btn="@a main s">购买</button>
717
791
  </li>
718
792
  </ul>
719
793
  ```
@@ -1045,7 +1119,7 @@ function toggleElderlyMode() {
1045
1119
  </ul>
1046
1120
 
1047
1121
  <!-- 移动端汉堡按钮 -->
1048
- <button ui-hide=">mob" ui-btn="none s">
1122
+ <button ui-hide=">mob" ui-btn="@a none s">
1049
1123
  <i class="icon-menu"></i>
1050
1124
  </button>
1051
1125
  </nav>
@@ -1058,95 +1132,97 @@ function toggleElderlyMode() {
1058
1132
  ### ui-btn 语法
1059
1133
 
1060
1134
  ```html
1061
- ui-btn="[@{flag}] {color} {size} [:{modifier}]"
1135
+ ui-btn="@{theme} [{color}] [{size}] [:{modifier}...]"
1062
1136
 
1063
- @{flag}:
1064
- @a = 块级按钮 (width: 100%)
1065
- @i = 内联按钮 (inline-flex)
1137
+ @{theme}(必填):
1138
+ @a, @b // 按钮主题风格;不写则没有按钮样式
1066
1139
 
1067
1140
  {color}:
1068
- main, vice, well, warn, risk, info, none
1141
+ main vice well warn risk info none text read desc note case line weak back w b link
1069
1142
 
1070
1143
  {size}:
1071
- s, m (默认), l
1144
+ xs s m(默认) l xl
1072
1145
 
1073
1146
  :{modifier}:
1074
- :round = 圆形按钮
1075
- :border = 边框按钮
1076
- :text = 文本按钮
1147
+ :round // 胶囊圆角
1148
+ :square // 正方形(图标按钮)
1149
+ :border // 线框
1150
+ :underline // 文字按钮(透明底,悬停下划线)
1151
+ :block // 宽度 100%
1152
+ :disabled // 视觉禁用
1077
1153
  ```
1078
1154
 
1079
1155
  ### 基础按钮
1080
1156
 
1081
1157
  ```html
1082
1158
  <!-- 主色按钮 -->
1083
- <button ui-btn="main">主操作</button>
1159
+ <button ui-btn="@a main">主操作</button>
1084
1160
 
1085
1161
  <!-- 辅助色按钮 -->
1086
- <button ui-btn="vice">次要操作</button>
1162
+ <button ui-btn="@a vice">次要操作</button>
1087
1163
 
1088
1164
  <!-- 成功按钮 -->
1089
- <button ui-btn="well">提交</button>
1165
+ <button ui-btn="@a well">提交</button>
1090
1166
 
1091
1167
  <!-- 警告按钮 -->
1092
- <button ui-btn="warn">警告</button>
1168
+ <button ui-btn="@a warn">警告</button>
1093
1169
 
1094
1170
  <!-- 危险按钮 -->
1095
- <button ui-btn="risk">删除</button>
1171
+ <button ui-btn="@a risk">删除</button>
1096
1172
 
1097
1173
  <!-- 信息按钮 -->
1098
- <button ui-btn="info">详情</button>
1174
+ <button ui-btn="@a info">详情</button>
1099
1175
 
1100
1176
  <!-- 无样式按钮 -->
1101
- <button ui-btn="none">纯文本</button>
1177
+ <button ui-btn="@a none">纯文本</button>
1102
1178
  ```
1103
1179
 
1104
1180
  ### 尺寸变体
1105
1181
 
1106
1182
  ```html
1107
- <button ui-btn="main s">小按钮</button>
1108
- <button ui-btn="main m">中按钮</button>
1109
- <button ui-btn="main l">大按钮</button>
1183
+ <button ui-btn="@a main s">小按钮</button>
1184
+ <button ui-btn="@a main m">中按钮</button>
1185
+ <button ui-btn="@a main l">大按钮</button>
1110
1186
  ```
1111
1187
 
1112
1188
  ### 块级按钮
1113
1189
 
1114
1190
  ```html
1115
1191
  <!-- 100% 宽度 -->
1116
- <button ui-btn="@a main">登录</button>
1192
+ <button ui-btn="@a main :block">登录</button>
1117
1193
  ```
1118
1194
 
1119
1195
  ### 样式修饰符
1120
1196
 
1121
1197
  ```html
1122
- <!-- 圆形按钮 -->
1123
- <button ui-btn="main :round">
1198
+ <!-- 胶囊按钮 -->
1199
+ <button ui-btn="@a main :round">
1124
1200
  <i class="icon-check"></i>
1125
1201
  </button>
1126
1202
 
1127
1203
  <!-- 边框按钮 -->
1128
- <button ui-btn="main :border">边框样式</button>
1204
+ <button ui-btn="@a main :border">边框样式</button>
1129
1205
 
1130
1206
  <!-- 文本按钮 -->
1131
- <button ui-btn="main :text">文本链接</button>
1207
+ <button ui-btn="@a main :underline">文本链接</button>
1132
1208
  ```
1133
1209
 
1134
1210
  ### 组合使用
1135
1211
 
1136
1212
  ```html
1137
- <!-- 块级 + 大尺寸 + 圆形 -->
1138
- <button ui-btn="@a main l :round">提交订单</button>
1213
+ <!-- 块级 + 大尺寸 + 胶囊 -->
1214
+ <button ui-btn="@a main l :round :block">提交订单</button>
1139
1215
 
1140
1216
  <!-- 小尺寸 + 边框 -->
1141
- <button ui-btn="vice s :border">取消</button>
1217
+ <button ui-btn="@a vice s :border">取消</button>
1142
1218
  ```
1143
1219
 
1144
1220
  ### 按钮组
1145
1221
 
1146
1222
  ```html
1147
1223
  <div ui-flex="row lm">
1148
- <button ui-btn="main">确定</button>
1149
- <button ui-btn="none :border" class="ml-sm">取消</button>
1224
+ <button ui-btn="@a main">确定</button>
1225
+ <button ui-btn="@a none :border" class="ml-sm">取消</button>
1150
1226
  </div>
1151
1227
  ```
1152
1228
 
@@ -1251,13 +1327,12 @@ w-ss ~ w-xl // 1em ~ 5.5em
1251
1327
 
1252
1328
  // 分段扩展
1253
1329
  w-ll*s // 15em
1254
- w-ll*m // 36em
1255
- w-ll*l // 78em
1330
+ w-ll*m // 27em
1331
+ w-ll*l // 66em
1256
1332
 
1257
1333
  // 特殊值
1258
1334
  w-full // 100%
1259
1335
  w-auto // auto
1260
- w-screen // 100vw
1261
1336
  ```
1262
1337
 
1263
1338
  #### Height
@@ -1266,7 +1341,6 @@ w-screen // 100vw
1266
1341
  h-{size} // 同 width
1267
1342
  h-full // 100%
1268
1343
  h-auto // auto
1269
- h-screen // 100vh
1270
1344
  ```
1271
1345
 
1272
1346
  ### 圆角类 (Border Radius)
@@ -1306,23 +1380,24 @@ fs-xs*m ~ fs-xl*m // 5rem ~ 10rem
1306
1380
  fs-xs*l ~ fs-xl*l // 11rem ~ 21rem
1307
1381
 
1308
1382
  // 字重
1309
- thin // font-weight: 100
1310
- light // 300
1311
- normal // 400
1312
- bold // 700
1313
- bolder // 900
1314
-
1315
- // 对齐
1316
- text-left
1317
- text-center
1318
- text-right
1319
- text-justify
1383
+ bold // font-weight: bold
1384
+ fw1 ~ fw9 // font-weight: 100 ~ 900
1385
+ fw0 // font-weight: normal
1386
+
1387
+ // 文字对齐(-sub 作用于直接子元素)
1388
+ al // 左
1389
+ ac // 中
1390
+ ar // 右
1391
+ aj // 两端
1392
+
1393
+ // 垂直对齐
1394
+ vt vm vb
1320
1395
 
1321
1396
  // 行高
1322
- lh-xs ~ lh-xl // line-height
1397
+ lh-no ~ lh-xl // line-height(lh-xs = 1 … lh-xl = 3.5;无 lh-sl)
1323
1398
 
1324
- // 字母间距
1325
- ls-xs ~ ls-xl // letter-spacing
1399
+ // 大小写
1400
+ upper lower
1326
1401
  ```
1327
1402
 
1328
1403
  ### 边框类 (Border)
@@ -1369,68 +1444,50 @@ ol-xs ~ ol-xl // left
1369
1444
  ### Z轴类 (Z-Index)
1370
1445
 
1371
1446
  ```scss
1372
- z-xs // z-index: 10
1373
- z-ss // 20
1374
- z-sm // 30
1375
- z-mm // 50
1376
- z-ml // 70
1377
- z-ll // 90
1378
- z-xl // 100
1447
+ z-no // z-index: 0
1448
+ z-xs // 1
1449
+ z-ss ~ z-xl // 2 ~ 11
1450
+ z-xx // 12
1451
+ z-mm:hover // hover 时生效
1379
1452
  ```
1380
1453
 
1381
- ### 阴影类 (Shadow)
1454
+ ### 阴影
1382
1455
 
1383
- ```scss
1384
- shadow-xs // 浅阴影
1385
- shadow-sm
1386
- shadow-mm // 默认阴影
1387
- shadow-ml
1388
- shadow-ll // 深阴影
1389
- shadow-none // 无阴影
1390
- ```
1456
+ NeatUI 不提供通用阴影 class(没有 `shadow-*`)。需要阴影时由组件自身样式或项目样式提供。
1391
1457
 
1392
1458
  ### 显示类 (Display)
1393
1459
 
1394
1460
  ```scss
1395
- block // display: block
1396
- inline // display: inline
1397
- inline-block
1398
- flex // display: flex (推荐用 ui-flex)
1399
- grid // display: grid (推荐用 ui-grid)
1400
- hidden // display: none
1461
+ block // display: block
1462
+ inline // display: inline
1463
+ inline-block // 同 dib
1464
+ flex // display: flex(布局推荐用 ui-flex)
1465
+ inline-flex
1466
+ none // display: none
1467
+ hide // opacity: 0(保留占位)
1468
+ // 以上均有 -sub,作用于直接子元素
1401
1469
 
1402
1470
  // Flex 子项
1403
- flex-block // flex: 1
1404
- flex-fill // flex: 1,不裁切(overflow 不变,min-width: 0)
1405
- flex-auto // flex: auto
1406
- flex-none // flex: none
1471
+ flex-block // flex: 1,overflow: hidden
1472
+ flex-fill // flex: 1,min-width: 0,不裁切
1473
+ flex-grow // 只放大不缩小
1474
+ flex-shrink // 只缩小不放大
1475
+ flex-fixed // 不放大不缩小
1407
1476
  ```
1408
1477
 
1409
1478
  ### 溢出类 (Overflow)
1410
1479
 
1411
1480
  ```scss
1412
- overflow-auto
1413
- overflow-hidden
1414
- overflow-scroll
1415
- overflow-x-auto
1416
- overflow-y-auto
1417
- overflow-x-hidden
1418
- overflow-y-hidden
1481
+ scroll // overflow: auto
1482
+ scroll-x // overflow-x: auto
1483
+ scroll-y // overflow-y: auto
1419
1484
  ```
1420
1485
 
1421
- 滚动系统同时保留 `.ui-scroll` 等 class 写法;`ui-scroll` attribute 提供
1422
- `stable`、五档 scrollbar 尺寸以及 x/y auto、hidden、unset。800px 以上的尺寸覆盖
1423
- 只作用于 attribute 形式。
1486
+ 没有 `overflow-*` class。更多滚动控制用 `ui-scroll` 属性:`:x` `:y` `:hidden` `x:hidden` `y:hidden` `x:unset` `y:unset` `stable`,滚动条尺寸 `xs s m l xl`。800px 以上的尺寸覆盖只作用于属性形式。
1424
1487
 
1425
- ### 光标类 (Cursor)
1488
+ ### 光标
1426
1489
 
1427
- ```scss
1428
- cursor-pointer
1429
- cursor-default
1430
- cursor-not-allowed
1431
- cursor-text
1432
- cursor-move
1433
- ```
1490
+ 没有 `cursor-*` class。需要 pointer 光标时用交互类:`ux-click` / `ux-none`(见下方交互类)。
1434
1491
 
1435
1492
  ### 交互类 (Interaction)
1436
1493
 
@@ -1520,7 +1577,7 @@ cursor-move
1520
1577
  ```vue
1521
1578
  <!-- 封装常用卡片 -->
1522
1579
  <template>
1523
- <div class="card bg-fore n-mm r-sm shadow-sm">
1580
+ <div class="card bg-fore n-mm r-sm">
1524
1581
  <slot />
1525
1582
  </div>
1526
1583
  </template>
@@ -1551,9 +1608,9 @@ cursor-move
1551
1608
  ### 场景 1: 登录页面
1552
1609
 
1553
1610
  ```html
1554
- <div ui-flex="row cm" class="h-screen bg-weak">
1555
- <div class="w-ll*s bg-fore n-ll r-ml shadow-ml">
1556
- <h1 class="fs-xl bold co-main text-center">登录</h1>
1611
+ <div ui-flex="row cm" class="h-full bg-weak"> <!-- 父级需有确定高度 -->
1612
+ <div class="w-ll*s bg-fore n-ll r-ml">
1613
+ <h1 class="fs-xl bold co-main ac">登录</h1>
1557
1614
 
1558
1615
  <form class="mt-lm">
1559
1616
  <div class="mb-mm">
@@ -1572,7 +1629,7 @@ cursor-move
1572
1629
  />
1573
1630
  </div>
1574
1631
 
1575
- <button ui-btn="@a main l" class="mt-ml">
1632
+ <button ui-btn="@a main l :block" class="mt-ml">
1576
1633
  登录
1577
1634
  </button>
1578
1635
  </form>
@@ -1590,7 +1647,7 @@ cursor-move
1590
1647
  <li
1591
1648
  v-for="product in products"
1592
1649
  :key="product.id"
1593
- class="bg-fore r-sm shadow-sm"
1650
+ class="bg-fore r-sm"
1594
1651
  >
1595
1652
  <img :src="product.image" class="w-full h-auto" />
1596
1653
 
@@ -1600,7 +1657,7 @@ cursor-move
1600
1657
 
1601
1658
  <div ui-flex="row xm" class="mt-mm">
1602
1659
  <span class="co-risk bold fs-ml">¥{{ product.price }}</span>
1603
- <button ui-btn="main s">购买</button>
1660
+ <button ui-btn="@a main s">购买</button>
1604
1661
  </div>
1605
1662
  </div>
1606
1663
  </li>
@@ -1611,7 +1668,7 @@ cursor-move
1611
1668
  ### 场景 3: 导航栏
1612
1669
 
1613
1670
  ```html
1614
- <nav class="pf ot-no w-full bg-fore shadow-sm z-xl">
1671
+ <nav class="pf ot-no w-full bg-fore z-xl">
1615
1672
  <div class="doc" ui-flex="row xm" class="ny-sm">
1616
1673
  <!-- Logo -->
1617
1674
  <div ui-flex="row lm">
@@ -1634,12 +1691,12 @@ cursor-move
1634
1691
 
1635
1692
  <!-- 操作按钮 -->
1636
1693
  <div ui-flex="row lm">
1637
- <button ui-btn="vice s :border" class="mr-sm">登录</button>
1638
- <button ui-btn="main s">注册</button>
1694
+ <button ui-btn="@a vice s :border" class="mr-sm">登录</button>
1695
+ <button ui-btn="@a main s">注册</button>
1639
1696
  </div>
1640
1697
 
1641
1698
  <!-- 移动端汉堡菜单 -->
1642
- <button ui-hide=">mob" ui-btn="none" @click="toggleMenu">
1699
+ <button ui-hide=">mob" ui-btn="@a none" @click="toggleMenu">
1643
1700
  <i class="icon-menu fs-ml"></i>
1644
1701
  </button>
1645
1702
  </div>
@@ -1655,11 +1712,11 @@ cursor-move
1655
1712
  ui-flex="row cm"
1656
1713
  @click.self="closeDialog"
1657
1714
  >
1658
- <div class="w-ll*s bg-fore r-ml shadow-ll">
1715
+ <div class="w-ll*s bg-fore r-ml">
1659
1716
  <!-- 头部 -->
1660
1717
  <div class="n-mm bb-xs b-line" ui-flex="row xm">
1661
1718
  <h3 class="fs-lm bold co-main">标题</h3>
1662
- <button ui-btn="none s" @click="closeDialog">
1719
+ <button ui-btn="@a none s" @click="closeDialog">
1663
1720
  <i class="icon-close"></i>
1664
1721
  </button>
1665
1722
  </div>
@@ -1671,10 +1728,10 @@ cursor-move
1671
1728
 
1672
1729
  <!-- 底部 -->
1673
1730
  <div class="n-mm bt-xs b-line" ui-flex="row rm">
1674
- <button ui-btn="none :border" class="mr-sm" @click="closeDialog">
1731
+ <button ui-btn="@a none :border" class="mr-sm" @click="closeDialog">
1675
1732
  取消
1676
1733
  </button>
1677
- <button ui-btn="main" @click="confirm">
1734
+ <button ui-btn="@a main" @click="confirm">
1678
1735
  确定
1679
1736
  </button>
1680
1737
  </div>
@@ -1685,14 +1742,14 @@ cursor-move
1685
1742
  ### 场景 5: 数据表格
1686
1743
 
1687
1744
  ```html
1688
- <div class="bg-fore r-sm shadow-sm">
1745
+ <div class="bg-fore r-sm">
1689
1746
  <table class="w-full">
1690
1747
  <thead class="bb-xs b-line">
1691
1748
  <tr>
1692
- <th class="n-mm text-left co-desc bold">姓名</th>
1693
- <th class="n-mm text-left co-desc bold">邮箱</th>
1694
- <th class="n-mm text-left co-desc bold">状态</th>
1695
- <th class="n-mm text-right co-desc bold">操作</th>
1749
+ <th class="n-mm al co-desc bold">姓名</th>
1750
+ <th class="n-mm al co-desc bold">邮箱</th>
1751
+ <th class="n-mm al co-desc bold">状态</th>
1752
+ <th class="n-mm ar co-desc bold">操作</th>
1696
1753
  </tr>
1697
1754
  </thead>
1698
1755
  <tbody>
@@ -1708,9 +1765,9 @@ cursor-move
1708
1765
  活跃
1709
1766
  </span>
1710
1767
  </td>
1711
- <td class="n-mm text-right">
1712
- <button ui-btn="info s :text">编辑</button>
1713
- <button ui-btn="risk s :text">删除</button>
1768
+ <td class="n-mm ar">
1769
+ <button ui-btn="@a info s :underline">编辑</button>
1770
+ <button ui-btn="@a risk s :underline">删除</button>
1714
1771
  </td>
1715
1772
  </tr>
1716
1773
  </tbody>
@@ -1776,11 +1833,7 @@ $theme: (
1776
1833
  <!-- Active -->
1777
1834
  <button class="bg-main bg-main-b-sm:active">按钮</button>
1778
1835
 
1779
- <!-- Focus -->
1780
- <input class="b-line b-main:focus" />
1781
-
1782
- <!-- Disabled -->
1783
- <button class="bg-weak:disabled" disabled>禁用</button>
1836
+ <!-- 只有 :hover 与 :active 两种状态后缀;没有 :focus / :disabled -->
1784
1837
  ```
1785
1838
 
1786
1839
  ### 4. 组合类名简化
@@ -1788,7 +1841,7 @@ $theme: (
1788
1841
  ```vue
1789
1842
  <script setup>
1790
1843
  // 创建常用组合
1791
- const cardClass = 'bg-fore n-mm r-sm shadow-sm'
1844
+ const cardClass = 'bg-fore n-mm r-sm'
1792
1845
  const titleClass = 'fs-lm bold co-main'
1793
1846
  const descClass = 'co-desc fs-sm my-ss'
1794
1847
  </script>
@@ -1845,7 +1898,7 @@ fs-lm pad:fs-mm mob:fs-sm
1845
1898
  ui-hide="<pad"
1846
1899
 
1847
1900
  <!-- 按钮系统 -->
1848
- ui-btn="@a main l :round"
1901
+ ui-btn="@a main l :round :block"
1849
1902
  ```
1850
1903
 
1851
1904
  ---
@@ -1854,7 +1907,7 @@ ui-btn="@a main l :round"
1854
1907
 
1855
1908
  - **官网**: http://neatui.fekit.cn
1856
1909
  - **NPM**: https://www.npmjs.com/package/@neatui/css
1857
- - **当前版本**: v4.0.0
1910
+ - **当前版本**: v5.x
1858
1911
  - **作者**: xiaojunbo
1859
1912
  - **许可**: MIT
1860
1913
 
@@ -1863,4 +1916,4 @@ ui-btn="@a main l :round"
1863
1916
  *本文档是人工维护的使用说明;实际能力以 `@neatui/css` SCSS 源码和构建输出为准,
1864
1917
  大版本语义变化以 `MIGRATION-4.0.md` 为准。*
1865
1918
 
1866
- *最后更新: 2026-07-28*
1919
+ *最后更新: 2026-11-02*
package/README.md CHANGED
@@ -4,6 +4,16 @@
4
4
 
5
5
  NeatUI 约束型原子设计系统(SCSS)。正式项目用 SCSS 自定义 `$theme`;试用可用预编译 preview(默认 light / dark)。
6
6
 
7
+ ## 使用手册(AI 必读)
8
+
9
+ 编写 NeatUI 代码前,请先阅读包内 [`GUIDE.md`](./GUIDE.md) 开头的「规则速查」:它列出全部可用写法和禁止清单,未列出的 class / 属性值视为不存在。
10
+
11
+ 让项目里的 AI 自动遵守这些规则:在你项目的 `AGENTS.md`(或 `CLAUDE.md`)中加一行:
12
+
13
+ ```md
14
+ - 使用 NeatUI 样式前先读 `node_modules/@neatui/css/GUIDE.md` 的「规则速查」,只使用其中列出的写法。
15
+ ```
16
+
7
17
  ## 更新与升级
8
18
 
9
19
  升级前请查看 [更新记录与迁移说明](./CHANGELOG.md)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatui/css",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "description": "NeatUI constrained atomic design system — SCSS source for production themes, plus preview CSS with default light/dark",
5
5
  "main": "./neatui.scss",
6
6
  "sass": "./neatui.scss",
@@ -457,6 +457,182 @@
457
457
  "pad",
458
458
  "dpc"
459
459
  ]
460
+ },
461
+ "ui-wrap": {
462
+ "intent": "文字换行:有该属性即默认不换行;no 不换行,all 全部换行,断点值(同 ui-hide)列出的范围换行、其余不换行;可空格组合。替代已移除的 wrap / nowrap 类。",
463
+ "managed": true,
464
+ "values": [
465
+ {
466
+ "value": "no",
467
+ "intent": "三端都不换行(no + wrap,对应 CSS nowrap)。",
468
+ "group": "all"
469
+ },
470
+ {
471
+ "value": "all",
472
+ "intent": "三端都换行。",
473
+ "group": "all"
474
+ },
475
+ {
476
+ "value": "=mob-s",
477
+ "intent": "仅 mob-s(≤479px)换行。",
478
+ "group": "equal"
479
+ },
480
+ {
481
+ "value": "=mob-m",
482
+ "intent": "仅 mob-m(480–639px)换行。",
483
+ "group": "equal"
484
+ },
485
+ {
486
+ "value": "=mob-l",
487
+ "intent": "仅 mob-l(640–799px)换行。",
488
+ "group": "equal"
489
+ },
490
+ {
491
+ "value": "=pad-s",
492
+ "intent": "仅 pad-s(800–959px)换行。",
493
+ "group": "equal"
494
+ },
495
+ {
496
+ "value": "=pad-m",
497
+ "intent": "仅 pad-m(960–1119px)换行。",
498
+ "group": "equal"
499
+ },
500
+ {
501
+ "value": "=pad-l",
502
+ "intent": "仅 pad-l(1120–1279px)换行。",
503
+ "group": "equal"
504
+ },
505
+ {
506
+ "value": "=dpc-s",
507
+ "intent": "仅 dpc-s(1280–1439px)换行。",
508
+ "group": "equal"
509
+ },
510
+ {
511
+ "value": "=dpc-m",
512
+ "intent": "仅 dpc-m(1440–1599px)换行。",
513
+ "group": "equal"
514
+ },
515
+ {
516
+ "value": "=dpc-l",
517
+ "intent": "仅 dpc-l(≥1600px)换行。",
518
+ "group": "equal"
519
+ },
520
+ {
521
+ "value": "=mob",
522
+ "intent": "仅 mob 设备段(≤799px)换行。",
523
+ "group": "equal"
524
+ },
525
+ {
526
+ "value": "=pad",
527
+ "intent": "仅 pad 设备段(800–1279px)换行。",
528
+ "group": "equal"
529
+ },
530
+ {
531
+ "value": "=dpc",
532
+ "intent": "仅 dpc 设备段(≥1280px)换行。",
533
+ "group": "equal"
534
+ },
535
+ {
536
+ "value": ">mob-s",
537
+ "intent": "大于 mob-s(≥480px)换行。",
538
+ "group": "greater-than"
539
+ },
540
+ {
541
+ "value": ">mob-m",
542
+ "intent": "大于 mob-m(≥640px)换行。",
543
+ "group": "greater-than"
544
+ },
545
+ {
546
+ "value": ">mob-l",
547
+ "intent": "大于 mob-l(≥800px)换行。",
548
+ "group": "greater-than"
549
+ },
550
+ {
551
+ "value": ">pad-s",
552
+ "intent": "大于 pad-s(≥960px)换行。",
553
+ "group": "greater-than"
554
+ },
555
+ {
556
+ "value": ">pad-m",
557
+ "intent": "大于 pad-m(≥1120px)换行。",
558
+ "group": "greater-than"
559
+ },
560
+ {
561
+ "value": ">pad-l",
562
+ "intent": "大于 pad-l(≥1280px)换行。",
563
+ "group": "greater-than"
564
+ },
565
+ {
566
+ "value": ">dpc-s",
567
+ "intent": "大于 dpc-s(≥1440px)换行。",
568
+ "group": "greater-than"
569
+ },
570
+ {
571
+ "value": ">dpc-m",
572
+ "intent": "大于 dpc-m(≥1600px)换行。",
573
+ "group": "greater-than"
574
+ },
575
+ {
576
+ "value": ">mob",
577
+ "intent": "大于 mob(≥800px)换行。",
578
+ "group": "greater-than"
579
+ },
580
+ {
581
+ "value": ">pad",
582
+ "intent": "大于 pad(≥1280px)换行。",
583
+ "group": "greater-than"
584
+ },
585
+ {
586
+ "value": "<mob-m",
587
+ "intent": "小于 mob-m(≤479px)换行。",
588
+ "group": "less-than"
589
+ },
590
+ {
591
+ "value": "<mob-l",
592
+ "intent": "小于 mob-l(≤639px)换行。",
593
+ "group": "less-than"
594
+ },
595
+ {
596
+ "value": "<pad-s",
597
+ "intent": "小于 pad-s(≤799px)换行。",
598
+ "group": "less-than"
599
+ },
600
+ {
601
+ "value": "<pad-m",
602
+ "intent": "小于 pad-m(≤959px)换行。",
603
+ "group": "less-than"
604
+ },
605
+ {
606
+ "value": "<pad-l",
607
+ "intent": "小于 pad-l(≤1119px)换行。",
608
+ "group": "less-than"
609
+ },
610
+ {
611
+ "value": "<dpc-s",
612
+ "intent": "小于 dpc-s(≤1279px)换行。",
613
+ "group": "less-than"
614
+ },
615
+ {
616
+ "value": "<dpc-m",
617
+ "intent": "小于 dpc-m(≤1439px)换行。",
618
+ "group": "less-than"
619
+ },
620
+ {
621
+ "value": "<dpc-l",
622
+ "intent": "小于 dpc-l(≤1599px)换行。",
623
+ "group": "less-than"
624
+ },
625
+ {
626
+ "value": "<pad",
627
+ "intent": "小于 pad(≤799px)换行。",
628
+ "group": "less-than"
629
+ },
630
+ {
631
+ "value": "<dpc",
632
+ "intent": "小于 dpc(≤1279px)换行。",
633
+ "group": "less-than"
634
+ }
635
+ ]
460
636
  }
461
637
  },
462
638
  "fit": {