@neatui/css 5.3.0 → 5.4.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.
package/GUIDE.md CHANGED
@@ -933,6 +933,29 @@ dpc, dpc-s, dpc-m, dpc-l
933
933
 
934
934
  除两个兼容空端点外,命中的规则都使用 `display: none !important`。
935
935
 
936
+ ### 按断点换行 `ui-wrap`
937
+
938
+ 元素带上 `ui-wrap` 即默认不换行,只在列出的范围内换行。取值与 `ui-hide` 相同(`>`、`<`、`=` + 九档细分值或设备段别名),可用空格组合;另有 `all` 表示全部换行,空值表示全部不换行。
939
+
940
+ | 换行的端 | 写法 |
941
+ | --- | --- |
942
+ | 都不换行 | `ui-wrap=""` |
943
+ | 仅移动 | `ui-wrap="=mob"` |
944
+ | 仅平板 | `ui-wrap="=pad"` |
945
+ | 仅桌面 | `ui-wrap="=dpc"` |
946
+ | 移动 + 平板 | `ui-wrap="<dpc"` |
947
+ | 平板 + 桌面 | `ui-wrap=">mob"` |
948
+ | 移动 + 桌面 | `ui-wrap="=mob =dpc"` |
949
+ | 都换行 | `ui-wrap="all"` |
950
+
951
+ ```html
952
+ <!-- 仅中平板档(960px–1119px)换行 -->
953
+ <div ui-wrap="=pad-m">...</div>
954
+ ```
955
+
956
+ 写了 `ui-wrap` 时由它全权决定:规则位于 `wrap`、`nowrap` 及 `pad:`、`mob:` 前缀类之后,同优先级下会覆盖它们,不要混用。
957
+ `all` 不带媒体查询,比 `=mob =pad =dpc` 更可靠(后者在断点间的小数宽度,如 799.5px,不会命中)。
958
+
936
959
  ### 响应式 class 前缀
937
960
 
938
961
  组件级 class 使用 `base → pad → mob` 三层覆盖;`pad:` 在最大 1279px 生效,
package/core/basic.scss CHANGED
@@ -1,5 +1,6 @@
1
1
  @use "./media.scss" as *;
2
2
  @use "./vars.scss" as *;
3
+ @use "sass:list";
3
4
 
4
5
  @mixin base($d: "") {
5
6
  .#{$d}w-auto {
@@ -204,6 +205,33 @@
204
205
  @include base("mob\\:");
205
206
  }
206
207
 
208
+ // 按断点换行:有 ui-wrap 即默认不换行,列出的范围换行
209
+ // 取值同 ui-hide(>pad / <pad / =pad 及九档细分值),可空格组合;all 全部换行,空值全部不换行
210
+ // 必须位于 wrap / nowrap / pad: / mob: 之后,写了 ui-wrap 时由它全权决定
211
+ [ui-wrap] {
212
+ white-space: nowrap;
213
+ }
214
+ [ui-wrap~='all'] {
215
+ white-space: normal;
216
+ }
217
+ @each $q in ('>', '<', '=') {
218
+ @each $sz in $level {
219
+ $n: #{list.nth($sz, 1)};
220
+ [ui-wrap~='#{$q}#{$n}'] {
221
+ @include med('#{$q}#{$n}') {
222
+ white-space: normal;
223
+ }
224
+ }
225
+ }
226
+ }
227
+ @each $p in ('>mob', '>pad', '<pad', '<dpc', '=mob', '=pad', '=dpc') {
228
+ [ui-wrap~='#{$p}'] {
229
+ @include med($p) {
230
+ white-space: normal;
231
+ }
232
+ }
233
+ }
234
+
207
235
  // 代码
208
236
  code,
209
237
  .code {
package/dist/neatui.css CHANGED
@@ -939,6 +939,206 @@ sup{
939
939
  text-transform:lowercase;
940
940
  }
941
941
  }
942
+ [ui-wrap]{
943
+ white-space:nowrap;
944
+ }
945
+
946
+ [ui-wrap~=all]{
947
+ white-space:normal;
948
+ }
949
+
950
+ @media screen and (min-width:480px){
951
+ [ui-wrap~=">mob-s"]{
952
+ white-space:normal;
953
+ }
954
+ }
955
+
956
+ @media screen and (min-width:640px){
957
+ [ui-wrap~=">mob-m"]{
958
+ white-space:normal;
959
+ }
960
+ }
961
+
962
+ @media screen and (min-width:800px){
963
+ [ui-wrap~=">mob-l"]{
964
+ white-space:normal;
965
+ }
966
+ }
967
+
968
+ @media screen and (min-width:960px){
969
+ [ui-wrap~=">pad-s"]{
970
+ white-space:normal;
971
+ }
972
+ }
973
+
974
+ @media screen and (min-width:1120px){
975
+ [ui-wrap~=">pad-m"]{
976
+ white-space:normal;
977
+ }
978
+ }
979
+
980
+ @media screen and (min-width:1280px){
981
+ [ui-wrap~=">pad-l"]{
982
+ white-space:normal;
983
+ }
984
+ }
985
+
986
+ @media screen and (min-width:1440px){
987
+ [ui-wrap~=">dpc-s"]{
988
+ white-space:normal;
989
+ }
990
+ }
991
+
992
+ @media screen and (min-width:1600px){
993
+ [ui-wrap~=">dpc-m"]{
994
+ white-space:normal;
995
+ }
996
+ }
997
+
998
+ @media screen and (max-width:479px){
999
+ [ui-wrap~="<mob-m"]{
1000
+ white-space:normal;
1001
+ }
1002
+ }
1003
+
1004
+ @media screen and (max-width:639px){
1005
+ [ui-wrap~="<mob-l"]{
1006
+ white-space:normal;
1007
+ }
1008
+ }
1009
+
1010
+ @media screen and (max-width:799px){
1011
+ [ui-wrap~="<pad-s"]{
1012
+ white-space:normal;
1013
+ }
1014
+ }
1015
+
1016
+ @media screen and (max-width:959px){
1017
+ [ui-wrap~="<pad-m"]{
1018
+ white-space:normal;
1019
+ }
1020
+ }
1021
+
1022
+ @media screen and (max-width:1119px){
1023
+ [ui-wrap~="<pad-l"]{
1024
+ white-space:normal;
1025
+ }
1026
+ }
1027
+
1028
+ @media screen and (max-width:1279px){
1029
+ [ui-wrap~="<dpc-s"]{
1030
+ white-space:normal;
1031
+ }
1032
+ }
1033
+
1034
+ @media screen and (max-width:1439px){
1035
+ [ui-wrap~="<dpc-m"]{
1036
+ white-space:normal;
1037
+ }
1038
+ }
1039
+
1040
+ @media screen and (max-width:1599px){
1041
+ [ui-wrap~="<dpc-l"]{
1042
+ white-space:normal;
1043
+ }
1044
+ }
1045
+
1046
+ @media screen and (max-width:479px){
1047
+ [ui-wrap~="=mob-s"]{
1048
+ white-space:normal;
1049
+ }
1050
+ }
1051
+
1052
+ @media screen and (min-width:480px) and (max-width:639px){
1053
+ [ui-wrap~="=mob-m"]{
1054
+ white-space:normal;
1055
+ }
1056
+ }
1057
+
1058
+ @media screen and (min-width:640px) and (max-width:799px){
1059
+ [ui-wrap~="=mob-l"]{
1060
+ white-space:normal;
1061
+ }
1062
+ }
1063
+
1064
+ @media screen and (min-width:800px) and (max-width:959px){
1065
+ [ui-wrap~="=pad-s"]{
1066
+ white-space:normal;
1067
+ }
1068
+ }
1069
+
1070
+ @media screen and (min-width:960px) and (max-width:1119px){
1071
+ [ui-wrap~="=pad-m"]{
1072
+ white-space:normal;
1073
+ }
1074
+ }
1075
+
1076
+ @media screen and (min-width:1120px) and (max-width:1279px){
1077
+ [ui-wrap~="=pad-l"]{
1078
+ white-space:normal;
1079
+ }
1080
+ }
1081
+
1082
+ @media screen and (min-width:1280px) and (max-width:1439px){
1083
+ [ui-wrap~="=dpc-s"]{
1084
+ white-space:normal;
1085
+ }
1086
+ }
1087
+
1088
+ @media screen and (min-width:1440px) and (max-width:1599px){
1089
+ [ui-wrap~="=dpc-m"]{
1090
+ white-space:normal;
1091
+ }
1092
+ }
1093
+
1094
+ @media screen and (min-width:1600px){
1095
+ [ui-wrap~="=dpc-l"]{
1096
+ white-space:normal;
1097
+ }
1098
+ }
1099
+
1100
+ @media screen and (min-width:800px){
1101
+ [ui-wrap~=">mob"]{
1102
+ white-space:normal;
1103
+ }
1104
+ }
1105
+
1106
+ @media screen and (min-width:1280px){
1107
+ [ui-wrap~=">pad"]{
1108
+ white-space:normal;
1109
+ }
1110
+ }
1111
+
1112
+ @media screen and (max-width:799px){
1113
+ [ui-wrap~="<pad"]{
1114
+ white-space:normal;
1115
+ }
1116
+ }
1117
+
1118
+ @media screen and (max-width:1279px){
1119
+ [ui-wrap~="<dpc"]{
1120
+ white-space:normal;
1121
+ }
1122
+ }
1123
+
1124
+ @media screen and (max-width:799px){
1125
+ [ui-wrap~="=mob"]{
1126
+ white-space:normal;
1127
+ }
1128
+ }
1129
+
1130
+ @media screen and (min-width:800px) and (max-width:1279px){
1131
+ [ui-wrap~="=pad"]{
1132
+ white-space:normal;
1133
+ }
1134
+ }
1135
+
1136
+ @media screen and (min-width:1280px){
1137
+ [ui-wrap~="=dpc"]{
1138
+ white-space:normal;
1139
+ }
1140
+ }
1141
+
942
1142
  .code,code{
943
1143
  font-family:Menlo,Monaco,Courier New,monospace;
944
1144
  -webkit-font-smoothing:antialiased;