mvframe 1.0.93 → 1.0.95

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.
@@ -11,7 +11,7 @@ alwaysApply: true
11
11
  - **`alwaysApply: true` 只作用于 Cursor**:把本文件当作对话上下文里的规范读给 AI,**不会**在构建时自动给任何 `.vue` 挂上样式,也**不等于**工具类已生效。
12
12
  - **运行时要用工具类**,必须在应用入口(如 demo `main.js`、宿主项目)**已 `import` `mvframe` 的 `src/style/index.scss`(或包导出的 `style`)**;然后在组件 **template 里写上工具类名**(如 `flexMode`、`g16`、`fs14`),尽量少写与工具类等价的 scoped 声明。
13
13
 
14
- 样式入口为 `src/style/index.scss`,按模块拆分为 `chip/*.scss`。
14
+ 样式入口为 `src/style/index.scss`,按模块拆分为 `chip/*.scss`。宿主项目如果只消费发布包,直接 `import "mvframe/style"` 即可拿到全局工具类;如果要在业务 SCSS 里复用框架断点 mixin,用 `@use "mvframe/style/mixin" as *;`。
15
15
 
16
16
  ## 1. 变量与颜色(var.scss)
17
17
 
@@ -166,6 +166,81 @@ alwaysApply: true
166
166
  - `g{N}`:gap,N=2~40(步长 2)
167
167
  - `mauto`:margin-inline auto
168
168
 
169
+ ## 4.1 响应式(media.scss + mixin.scss)
170
+
171
+ ### 断点
172
+
173
+ | 名称 | 范围 |
174
+ |------|------|
175
+ | `xs` | `< 40rem`(< 640px) |
176
+ | `sm` | `40rem ~ 47.99875rem`(640px ~ 767.98px) |
177
+ | `md` | `48rem ~ 63.99875rem`(768px ~ 1023.98px) |
178
+ | `lg` | `64rem ~ 79.99875rem`(1024px ~ 1279.98px) |
179
+ | `xl` | `80rem ~ 95.99875rem`(1280px ~ 1535.98px) |
180
+ | `xxl` | `>= 96rem`(>= 1536px) |
181
+
182
+ ### SCSS mixin
183
+
184
+ - `@include media-up(md) { ... }`:`md` 及以上
185
+ - `@include media-down(md) { ... }`:`md` 及以下
186
+ - `@include media-only(md) { ... }`:仅 `md`
187
+ - `@include media-between(sm, lg) { ... }`:`sm` 到 `lg`
188
+
189
+ 宿主项目若使用发布包,可直接在业务 SCSS 中:
190
+
191
+ ```scss
192
+ @use "mvframe/style/mixin" as *;
193
+
194
+ .panel {
195
+ padding: 1.5rem;
196
+
197
+ @include media-down(sm) {
198
+ padding: 1rem;
199
+ }
200
+ }
201
+ ```
202
+
203
+ ### 响应式工具类
204
+
205
+ `media.scss` 额外提供一批按断点包裹的全局工具类,命名为 `断点-范围-工具类`:
206
+
207
+ - 范围:`up` / `down` / `only`
208
+ - 工具类:`hide`、`block`、`inline`、`inlineBlock`、`flexMode`、`inlineFlex`、`grid`、`flexV`、`flexV-1`、`flexWrap`、`flexWrap-1`、`hl`、`hb`、`ha`、`hc`、`hr`、`vl`、`vr`、`vc`、`vs`、`txt-c`、`txt-r`
209
+
210
+ 示例:
211
+
212
+ - `class="md-down-hide"`:`md` 及以下隐藏
213
+ - `class="lg-up-flexMode lg-up-hb lg-up-vc"`:`lg` 及以上切到横向 flex 并两端对齐
214
+ - `class="xs-only-block sm-only-hide"`:只在手机端显示
215
+
216
+ ### Grid 断点列数类
217
+
218
+ 如果容器同时带有 `grid`,可直接写 `断点+列数` 来按屏宽切列数:
219
+
220
+ - `grid col2 md2 lg3 sm1`
221
+ - `grid col1 md2 xl4`
222
+
223
+ 规则:
224
+
225
+ - `col{N}`:默认列数(所有屏宽的基础值)
226
+ - `xs{N}` / `sm{N}` / `md{N}` / `lg{N}` / `xl{N}` / `xxl{N}`:仅在该断点区间覆盖 `grid-template-columns`
227
+ - 列数当前支持 `1~12`
228
+
229
+ 示例:
230
+
231
+ ```html
232
+ <div class="grid col2 md2 lg3 sm1 g16">
233
+ ...
234
+ </div>
235
+ ```
236
+
237
+ 含义:
238
+
239
+ - 默认 2 列
240
+ - `sm` 屏 1 列
241
+ - `md` 屏 2 列
242
+ - `lg` 屏 3 列
243
+
169
244
  ## 5. 其它样式(other.scss / static.scss)
170
245
 
171
246
  ### 全局重置与基础
@@ -232,6 +307,21 @@ alwaysApply: true
232
307
  - 如果只是标签颜色或形态变化,不要重写 scoped tag 样式,直接叠加现有变体
233
308
  - 只有在 `tag` 无法覆盖的专属视觉下,才在局部补 scoped 样式
234
309
 
310
+ ### Dot
311
+
312
+ 全局 `dot{N}` 是通用圆点样式,适合状态点、图例点、时间轴节点等纯色圆形标识。
313
+
314
+ | 类名 | 用途 |
315
+ |------|------|
316
+ | `dot4/dot8/dot10/dot12/dot14/dot16/dot18/dot20/dot24/dot28/dot30/dot32` | 圆点尺寸,源码按 px 设计稿维护,输出为 rem |
317
+ | `dot{N} primary/blue/green/yellow/orange/red/purple/pink/black/dark/body/white/gray` | 圆点颜色变体,默认 `primary` |
318
+
319
+ 使用建议:
320
+
321
+ - 直接组合类名:`class="dot8 orange"`、`class="dot12"`、`class="dot20 gray"`
322
+ - `dot{N}` 默认就是主色圆点;只有需要别的颜色时再叠加颜色类
323
+ - 这组样式只负责纯圆点本体;如果需要边框、发光、外层容器,优先额外包一层而不是改写 `dot{N}` 自身
324
+
235
325
  ### Tip 按钮与图标
236
326
 
237
327
  | 类名 | 用途 |
package/README.cn.md CHANGED
@@ -20,6 +20,7 @@
20
20
  - `"./composition"` → `dist/composition.js`(`import { useMap, … } from 'mvframe/composition'`)
21
21
  - `"./store"`、`"./directive"`、`"./util"` → 对应 `dist` 下分包
22
22
  - `"./notify"` → `dist/notify.js`(浏览器端请求本地 `mvframe-notify` 服务的通知 helper)
23
+ - `"./style/mixin"` → `src/style/chip/mixin.scss`(宿主项目 SCSS 可复用的断点 / 通用 mixin)
23
24
  - `"./style"` → `dist/css/style.css`(由 `src/style/index.scss` 单独入口打包的全量工具类/变量)
24
25
  - `"./style/cpt"` → `dist/css/cpt.css`(随组件抽取的样式;一般用 `mvframe/style` 即可)
25
26
 
@@ -147,8 +148,25 @@ app.use(mvframe, {
147
148
 
148
149
  - 工具类与变量说明见 `.cursor/rules/style-system.mdc`(`--color-*`、间距、字体、布局类等)。
149
150
  - SCSS 会通过 `vite.config.js` 的 **`additionalData`** 注入 **`src/style/chip/mixin.scss`**,与库同构构建的业务项目可保持一致配置。
151
+ - 响应式断点统一在 `mixin.scss`:`xs / sm / md / lg / xl / xxl`;业务 SCSS 可直接 `@use "mvframe/style/mixin" as *;`,然后使用 `@include media-up(md)`、`media-down(md)`、`media-only(md)`、`media-between(sm, lg)`。
152
+ - 发布包的 `mvframe/style` 里已内置一组响应式工具类:`{断点}-{up|down|only}-{工具类}`,例如 `md-down-hide`、`lg-up-flexMode`、`xs-only-block`。
153
+ - Grid 容器还支持断点列数类:`class="grid col2 md2 lg3 sm1"`,表示默认 2 列,`sm` 1 列,`md` 2 列,`lg` 3 列。
150
154
  - 发布包可 **`import 'mvframe/style'`**(即 `dist/css/style.css`);需与 Element Plus 等并存时仍可在业务工程中链入源码 **`src/style/index.scss`** 以便覆写变量。
151
155
 
156
+ 业务侧示例:
157
+
158
+ ```scss
159
+ @use "mvframe/style/mixin" as *;
160
+
161
+ .BillingPanel {
162
+ padding: 1.5rem;
163
+
164
+ @include media-down(sm) {
165
+ padding: 1rem;
166
+ }
167
+ }
168
+ ```
169
+
152
170
  ---
153
171
 
154
172
  ## 构建库
package/README.md CHANGED
@@ -20,6 +20,7 @@ A Vue 3 + Vite oriented admin-shell toolkit: **Frame layout**, **common business
20
20
  - `"./composition"` → `dist/composition.js` (e.g. `import { useMap } from 'mvframe/composition'`)
21
21
  - `"./store"`, `"./directive"`, `"./util"` → matching chunks under `dist`
22
22
  - `"./notify"` → `dist/notify.js` (browser helper for the local `mvframe-notify` service)
23
+ - `"./style/mixin"` → `src/style/chip/mixin.scss` (shared breakpoint and helper mixins for host SCSS)
23
24
  - `"./style"` → `dist/css/style.css` (full toolkit CSS from `src/style/index.scss` entry)
24
25
  - `"./style/cpt"` → `dist/css/cpt.css` (component-extracted CSS; usually `import 'mvframe/style'` is enough)
25
26
 
@@ -147,8 +148,25 @@ Full helper list: `.cursor/rules/util.mdc` and `src/util/index.js`.
147
148
 
148
149
  - Utility classes & tokens: `.cursor/rules/style-system.mdc` (`--color-*`, spacing, typography, layout).
149
150
  - `vite.config.js` **`additionalData`** injects **`src/style/chip/mixin.scss`**; mirror this in apps that compile the same SCSS tree.
151
+ - Breakpoints are centralized in `mixin.scss`: `xs / sm / md / lg / xl / xxl`. Host SCSS can `@use "mvframe/style/mixin" as *;` and use `@include media-up(md)`, `media-down(md)`, `media-only(md)`, or `media-between(sm, lg)`.
152
+ - `mvframe/style` now ships responsive utility classes in the shape `{breakpoint}-{up|down|only}-{utility}`, for example `md-down-hide`, `lg-up-flexMode`, and `xs-only-block`.
153
+ - Grid containers also support breakpoint column-count classes such as `class="grid col2 md2 lg3 sm1"`: default 2 columns, `sm` 1 column, `md` 2 columns, `lg` 3 columns.
150
154
  - Published packages can use **`import 'mvframe/style'`** (`dist/css/style.css`). For SCSS overrides, still link **`src/style/index.scss`** from Git/monorepo when needed.
151
155
 
156
+ Host SCSS example:
157
+
158
+ ```scss
159
+ @use "mvframe/style/mixin" as *;
160
+
161
+ .BillingPanel {
162
+ padding: 1.5rem;
163
+
164
+ @include media-down(sm) {
165
+ padding: 1rem;
166
+ }
167
+ }
168
+ ```
169
+
152
170
  ---
153
171
 
154
172
  ## Building the library