nomadro/.cursor/skills/multi-platform-ui-scale/SKILL.md
Eric 932f912087 Ship WeChat VIP↔Web bridge, netdisk sheet, and per-lesson materials gate for audit.
Freeze pre4 as the in-review weapp package; document pre5 as the next iteration branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-24 20:14:31 +08:00

61 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: multi-platform-ui-scale
description: >-
Nomadro 多端 UI 比例与 CSS 单位铁律:Web / H5 / 微信小程序 / 抖音小程序 / 小红书。
写或改任何弹窗、按钮、落地页、VIP LoginModal、Taro 样式时必须遵守;
禁止把 Web 桌面尺寸原样搬到小程序导致弹窗缩成一团。
---
# 多端 UI 比例铁律(写死,勿再问)
## 一句话
**Web 只参考结构与信息架构;最终尺寸必须按当前端的触控与单位体系适配。禁止「照抄 Web 的 px 弹窗」到微信/抖音/小红书。**
## 端与技术
| 端 | 路径 | 单位 / 设计稿 |
|----|------|----------------|
| Web 门户 VIP | `src/modules/vip` | CSS / Tailwind;桌面可居中 `max-w-[400px]` |
| Taro H5 SoT | `apps/miniprogram/h5` | 与落地页一致优先 **`rem`**(对齐 vip-landing) |
| 微信 weapp | `apps/miniprogram/weapp` · `designWidth: 750` | **裸写 `px` 会被转成 rpx → 尺寸腰斩** |
| 抖音 tt | `apps/miniprogram/tt` · `designWidth: 750` | 同 weapp |
| 小红书 xhs | `apps/miniprogram/xhs` | 同 Taro 750;纯工具页离线优先 |
H5 SoT 共用源码:`weapp/tt` 的 `sourceRoot` 指向 `../h5/src` —— **一处样式四端吃**,写样式时按「最严端(小程序)」适配。
## 强制规则
1. **小程序 / Taro 共用样式**
- 弹窗、表单、CTA:**用 `rem`(与 `vip-landing.scss` 同尺度)或显式 `rpx`**
- **禁止**在共用 SCSS 里写死 Web 桌面感的 `max-width: 400px` + 一堆裸 `px`(会被 750 稿压成拇指盖大的卡片)
- 触控热区:**≥ 44px 等价**(约 `2.75rem` / `88rpx`)
- 手机弹窗:**全宽底栏 sheet**(`align-items: flex-end` + 顶圆角);宽屏再可居中。不要默认桌面居中小卡片。
2. **Web VIP LoginModal**
- 仅参考:**标题「登录」+ Tab「账号/邮箱」+ 输入 +「验证并登录」+ 验证中全屏层**
- **不要**把 Web 的 `max-w-[400px]` 居中小卡原样搬进小程序
- 不要加品牌眉、副标题、字段标签等「超级优化」花活,除非产品明确要求
3. **参考 ≠ 复制尺寸**
- 结构、文案、交互流:可对齐 Web
- padding / font / 宽度 / 圆角:**按小程序重算**
4. **改弹窗前自检**
- [ ] 微信模拟器里弹窗是否接近屏宽、按钮是否好点
- [ ] 是否误用裸 `px` 导致缩水
- [ ] H5 / weapp / tt 是否同源样式、比例一致
## 反模式(禁止)
- 把 Web `LoginModal` 的 Tailwind 间距原样抄成 Taro `px`
- 小程序里居中一块「桌面对话框」又细又小
- 用户每次提醒「比例」才改 —— 本 skill 已写死,开工先遵守
## 关联
- 全端禁止 web-view:`.cursor/rules/no-webview-content.mdc`
- 远程配置 + 离线:`.cursor/rules/remote-config-offline.mdc`
- 现成正确示例:`apps/miniprogram/h5/src/components/VipLoginModal.scss`(rem + 底栏)
`apps/miniprogram/h5/src/styles/vip-landing.scss`