@namewta/skills-hub 0.1.52 → 0.1.53
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/THIRD_PARTY_NOTICES.md +16 -0
- package/package.json +1 -1
- package/skills/dev/dev-help/references/capabilities.md +1 -1
- package/skills/dev/dev-ui-design/SKILL.md +4 -1
- package/skills/dev/dev-ui-design/agents/openai.yaml +2 -2
- package/skills/dev/dev-ui-design/assets/design.md +4 -1
- package/skills/dev/dev-ui-design/assets/ui-audit.md +4 -1
- package/skills/dev/dev-ui-design/assets/visual-refinement/examples.js +236 -0
- package/skills/dev/dev-ui-design/assets/visual-refinement/index.html +104 -0
- package/skills/dev/dev-ui-design/assets/visual-refinement/styles.css +242 -0
- package/skills/dev/dev-ui-design/references/interaction-review.md +2 -0
- package/skills/dev/dev-ui-design/references/layout-review.md +34 -0
- package/skills/dev/dev-ui-design/references/minimal-style.md +11 -1
- package/skills/dev/dev-ui-design/references/product-ui.md +43 -0
- package/skills/dev/dev-ui-design/references/visual-refinement.md +92 -0
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -204,6 +204,22 @@ v0.1.29 继续按用户要求,移除其他 dev 运行技能对环境初始化
|
|
|
204
204
|
|
|
205
205
|
本次分发沿用已有 MIT 许可原件。外部项目仅作研究对照,没有新增复制其实现、字体、图标、品牌资产或网页全文。OpenAI 插件的许可依据为插件清单声明;Vercel 正文的许可依据为 web-interface-guidelines 仓库。固定 Apache-2.0、MIT、Geist OFL 以及品牌素材各自的依据按研究记录区分。
|
|
206
206
|
|
|
207
|
+
### UI 细节审美与原创案例
|
|
208
|
+
|
|
209
|
+
2026-12-04 的 [Issue #27](https://github.com/NAMEWTA/skills-hub/issues/27)及[本次来源快照](.agents/dev/changes/2026-12-04-ui-micro-aesthetics/source/github-issue-27.md)保存研究过程、来源身份与舍弃范围。本次新增中文诊断、条件与反例、离线 HTML/CSS/JS 和 SVG 示意图由本项目编写,没有引入来源的实现代码、字体、品牌图片或网页全文。
|
|
210
|
+
|
|
211
|
+
| 固定研究来源 | 本次采用的判断与本地落点 | 适配边界 |
|
|
212
|
+
| --- | --- | --- |
|
|
213
|
+
| OpenAI [frontend-app-builder](https://github.com/openai/plugins/blob/981b02c0c44058b595f3b4180002c3ae3c806d40/plugins/build-web-apps/skills/frontend-app-builder/SKILL.md),插件清单声明 MIT | 真实项目和内容取证、功能范围、浏览器复验 → `visual-refinement.md` 的诊断与收尾 | 沿用用户设计系统与本项目既有预设,未复制构建流程或安装外部工具。 |
|
|
214
|
+
| Anthropic [frontend-design](https://github.com/anthropics/skills/blob/6e83444ffacecd38b93d1be8381967de84a427f6/skills/frontend-design/SKILL.md),Apache-2.0 | 内容与任务支撑设计选择 → 模板化症状及保留理由 | 不把来源中的风格偏好转换成全局禁用字体或颜色清单。 |
|
|
215
|
+
| Impeccable [polish](https://github.com/pbakaus/impeccable/blob/1ca3ca27274107e6e129228a6dc32b67dcc833d3/skill/reference/polish.md)、[typeset](https://github.com/pbakaus/impeccable/blob/1ca3ca27274107e6e129228a6dc32b67dcc833d3/skill/reference/typeset.md)、layout、harden,Apache-2.0 | 局部层级、对齐、留白、真实长短内容与状态 → 现有 layout-review、product-ui 与 C2–C6 | 原创整理适用条件;不复制整套技能或将拉丁字形度量强加于中文。 |
|
|
216
|
+
| Vercel [web-design-guidelines](https://github.com/vercel-labs/agent-skills/blob/5a37a6329fbad3666c3207392a6a7c0110e92efb/skills/web-design-guidelines/SKILL.md)与[规范正文](https://github.com/vercel-labs/web-interface-guidelines/blob/434b7f91364665f2f733b310ec54809bf8f37937/README.md),MIT;Ibelick [baseline-ui](https://github.com/ibelick/skills/blob/d6b14c379c5b5450d2a2584e27ee722a799d30fb/skills/baseline-ui/SKILL.md),MIT | 溢出、文本平衡、数字字形、状态和可达性 → 中文排版、数字、操作状态方法 | 只在实际任务与字体支持时启用,保留自然换行与目标项目已有规则。 |
|
|
217
|
+
| W3C [中文排版需求 2026-11-04 草案](https://www.w3.org/TR/2026/DNOTE-clreq-20261104/)、[WCAG 2.2](https://www.w3.org/TR/WCAG22/)及 [2.5.3 Label in Name 解释](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html) | 标点、混排、颜色角色、目标尺寸与状态切换后的可见标签/可访问名称 → layout-review、minimal-style、product-ui | 中文排版需求是 Group Note Draft;规范、解释、设计启发与项目预设分别说明。 |
|
|
218
|
+
|
|
219
|
+
Grok 官方[设计师指南](https://docs.grok.com/build/agents-window/guides/designers)及 [xai-org/grok-build 固定快照](https://github.com/xai-org/grok-build/tree/2bdd1d6a6369de0e8c68132ea4539e9abd9e14a8)用于核对设计迭代和真实浏览器验证的能力边界。[byron-public/grok-build-skills](https://github.com/byron-public/grok-build-skills/tree/78f7974d4550b784347ca74e3c423ba373abc350)属于社区归档,维护者声称其来源于 Grok;本次未核实整个技能包的独立再分发许可,因此只记录研究观察,没有复制、翻译或分发该包。其 44px 等简写没有替代 WCAG 的具体等级和适用条件。
|
|
220
|
+
|
|
221
|
+
原有材料快照、独立中文运行包及逐文件采用映射未由本次研究批量刷新;已有许可文件继续保留。案例数字、任务数据和图形为教学用途,不代表附件中不可辨认的原始像素或文案。
|
|
222
|
+
|
|
207
223
|
### 原型与设计验证
|
|
208
224
|
|
|
209
225
|
主要复制适配来自已收录的 Speculo、Matt 和 pstack。Speculo 的[原型入口](https://github.com/NAMEWTA/Speculo/blob/994a64427a6784053dd092a86713870062cfde2f/template/workflows/specdev/specdev-p-prototype/SKILL.md)、[证据方法](https://github.com/NAMEWTA/Speculo/blob/994a64427a6784053dd092a86713870062cfde2f/template/workflows/specdev/specdev-p-prototype/references/design-evidence.md)和[完整引用示例](https://github.com/NAMEWTA/Speculo/blob/994a64427a6784053dd092a86713870062cfde2f/template/workflows/specdev/specdev-p-prototype/references/design-evidence-example.md)提供直接代码证据与同场景对照方法。
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
| `dev-parallel` | 切片覆盖、竞速与多候选比较,隔离写入并综合验证 |
|
|
19
19
|
| `dev-worktree` | 创建、接手、审计和回收隔离检出,按顺序合并回直接父分支并验证 Git 拓扑 |
|
|
20
20
|
| `dev-merge-conflict` | 定位并解决在途 Git 冲突,核对双方行为和实际组合验证 |
|
|
21
|
-
| `dev-ui-design` | 提取 CSS/token
|
|
21
|
+
| `dev-ui-design` | 提取 CSS/token 规范,按参考图或现状精修细节、减少模板感,审计布局、动效和可见键盘焦点,并按授权修复复验。确认原型由 `dev-prototype` 负责 |
|
|
22
22
|
| `dev-prototype` | 将已确认文档转成沿用项目风格的完整交互 HTML,取得并保留具体版本的用户确认;按需用探索分支回答未决问题 |
|
|
23
23
|
| `dev-build` | 按规格与适用的确认原型实施新功能、重构和视觉对齐;为既有正确行为补测,构建真实动作面板 |
|
|
24
24
|
| `dev-tdd` | 显式采用测试先行时,按公共接口逐行为红绿循环;在当前实现任务内作为方法使用 |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-ui-design
|
|
3
|
-
description: 从现有页面、CSS、token
|
|
3
|
+
description: 从现有页面、CSS、token 与组件提取项目设计规范,审计界面、交互与动效,为页面或局部预览制定设计,并按授权修复和复验。适用于“整理项目设计规则”“这个页面有 AI 味”“保持布局和功能,只把 UI 磨细”“学习参考图的审美细节”“检查列表为何错位”“核对浮层或日期条的键盘焦点”“直接修好这个界面”。只要求完整可交互确认原型时由 dev-prototype 负责。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 项目 UI 设计与优化
|
|
@@ -11,11 +11,14 @@ description: 从现有页面、CSS、token 与组件提取项目设计规范,
|
|
|
11
11
|
| --- | --- |
|
|
12
12
|
| 提取项目规范 | 按[设计系统取证](references/design-system.md)和[变量映射](references/design-tokens.md)交付来源、用途、值与调用方,区分观察、推断和建议。 |
|
|
13
13
|
| 审计页面或全项目 | 从[产品任务与验收](references/product-ui.md)确定旅程、风险和覆盖范围,按[问题模板](assets/ui-audit.md)记录可复现问题,交付报告。 |
|
|
14
|
+
| 按参考图或现状精修细节、减少模板感 | 按[细节精修](references/visual-refinement.md)把画面转成具体症状、适用规则、最小改法与同条件前后证据。保持用户限定的布局、功能和品牌,只审计时交付建议。 |
|
|
14
15
|
| 设计新页面、组件或局部预览 | 复用项目依据,用[设计记录](assets/design.md)说明布局、状态和完成条件。无基线或明确采用极简方向时读[极简预设](references/minimal-style.md)。营销任务另读[落地页方法](references/landing-page-guide.md)。 |
|
|
15
16
|
| 按授权修复并验证 | 复现问题,修改对应共享组件、变量或页面,沿原入口复验,并检查受影响的调用方。实际检查方式见[产品 UI](references/product-ui.md)。 |
|
|
16
17
|
|
|
17
18
|
无论从哪个入口开始,遇到错位、留白或长内容时读[布局审查](references/layout-review.md),遇到操作显露、菜单、非模态浮层及复合控件的可见焦点、反馈或撤回时读[交互审查](references/interaction-review.md)。审查状态切换、异步结果或性能时读[动效方法](references/motion.md)。已从代码或现有决定得到的答案直接使用。只有改变任务目标且无法推断的选择才问用户,其余工作继续。
|
|
18
19
|
|
|
20
|
+
“更有审美”须落实到具体画面和阅读、操作关系。参考图看不清的文字与数值保留未知,继续处理可辨认的关系。需要理解局部改法时,从精修方法打开对应的[原创微案例](assets/visual-refinement/index.html),不把案例当作业务页面模板或已确认原型。
|
|
21
|
+
|
|
19
22
|
提取和审计可在报告处结束。范围明确的小修用当前项目工具走完,独立安装即可使用。若当前 Change 需要完整新体验确认,由原负责人安排 `dev-prototype`,携带设计产物。已有确认覆盖的体验逐项引用页面、状态、内容版本及源码定位,决定变更时更新受影响的确认。
|
|
20
23
|
|
|
21
24
|
跨阶段交付沿用同一问题清单。需要正式实现、真实入口取证和独立审查时,分别由 `dev-build`、`dev-verify`、`dev-review` 承接,`dev-workflow` 协调。明确授权合并或发布时由 `dev-pr` 核对合并版本和 CI,`dev-deploy` 核实目标环境、版本、入口与恢复结果。报告逐项说明修复、验证、审查、合并及部署的实际状态。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "项目 UI 设计与优化"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "使用 $dev-ui-design
|
|
3
|
+
short_description: "提取规范,按参考图精修 UI,审计布局、交互与动效并用真实界面复验"
|
|
4
|
+
default_prompt: "使用 $dev-ui-design,从真实页面、样式、组件与可辨认的参考图取证,按本次要求提取规范、审计、设计或精修细节,保留指定的品牌、布局和功能,并说明前后证据与验证范围。"
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
- 用户任务、入口与完成信号:
|
|
7
7
|
- 现有页面、组件和 token 的代码位置:
|
|
8
8
|
- 已观察 / 推断 / 拟新增,冲突的来源、采用的决定及理由:
|
|
9
|
+
- 参考图来源、尺寸与对应区域;可辨认的关系、推断及无法辨认的信息(适用时):
|
|
9
10
|
- 确认原型入口、资源版本/指纹、确认记录与覆盖范围(适用时):
|
|
10
11
|
|
|
11
12
|
## 设计决定
|
|
@@ -13,8 +14,10 @@
|
|
|
13
14
|
- 关键使用路径与页面/区域分工(就近引用原型中的页面/状态):
|
|
14
15
|
- 复用项;新增项及理由:
|
|
15
16
|
- 产品 UI 或营销页;采用的视觉方向:
|
|
17
|
+
- 指定保留的品牌、布局、信息与动作;区域首先要读到的对象和下一步操作:
|
|
16
18
|
- 语义角色 → CSS 变量或 theme key → 实际主题值 → 使用组件:
|
|
17
19
|
- 布局参照轴、内容宽度、密度与长内容重排:
|
|
20
|
+
- 精修时的可见症状、任务影响、适用规则与最小改法;保留例外的理由:
|
|
18
21
|
|
|
19
22
|
## 行为与状态
|
|
20
23
|
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
|
|
26
29
|
## 验收与交接
|
|
27
30
|
|
|
28
|
-
| 可观察条件 | 实现入口 |
|
|
31
|
+
| 可观察条件 | 实现入口 | 同条件前后检查/截图 | 改善、无变化、退化或未验项 |
|
|
29
32
|
|---|---|---|---|
|
|
30
33
|
|
|
31
34
|
原型尚未确认或确认失效的部分如实标记;设计说明解释原型未直接表达的规则,不能代替用户体验确认或改写其可见效果。
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
范围、版本、入口、用户任务、环境与数据:
|
|
4
4
|
覆盖的路由/共享组件、未验及不适用项:
|
|
5
|
+
参考图来源、尺寸、对应区域与可辨认范围(适用时):
|
|
5
6
|
|
|
6
|
-
| 位置与状态变化 |
|
|
7
|
+
| 位置与状态变化 | 复现动作、可见症状及证据 | 用户影响与优先级 | 适用规则、最小改法与实际定位 | 同场景复验、版本与余项 |
|
|
7
8
|
| --- | --- | --- | --- | --- |
|
|
8
9
|
| | | | | |
|
|
9
10
|
|
|
10
11
|
同类问题合并记录,列出受影响调用方。只做审计时写建议。静态、正常播放、减少动效和性能结果各自注明证据。
|
|
12
|
+
|
|
13
|
+
精修按需要区分观察、假设与无法辨认的信息;保留有依据的例外。前后比较使用相同内容、状态与渲染条件,逐项记录改善、无明显变化、退化或未验证。简单问题用短段落,不为填写表格新增另一份报告。
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Clone one content source for each pair. Separate native control names retain
|
|
4
|
+
// keyboard semantics; shared case state makes either side update both views.
|
|
5
|
+
for (const comparison of document.querySelectorAll("[data-case]")) {
|
|
6
|
+
const caseId = comparison.dataset.case;
|
|
7
|
+
const template = document.getElementById(`sample-${caseId}`);
|
|
8
|
+
for (const side of ["before", "after"]) {
|
|
9
|
+
const specimen = document.createElement("section");
|
|
10
|
+
specimen.className = "specimen";
|
|
11
|
+
specimen.dataset.side = side;
|
|
12
|
+
const headingId = `${caseId}-${side}-heading`;
|
|
13
|
+
specimen.setAttribute("aria-labelledby", headingId);
|
|
14
|
+
specimen.innerHTML = `<div class="specimen-heading"><h3 id="${headingId}">${side === "before" ? "调整前" : "局部调整后"}</h3><span>内容与状态同步</span></div>`;
|
|
15
|
+
const sample = document.createElement("div");
|
|
16
|
+
sample.className = `sample sample--${side}`;
|
|
17
|
+
const content = template.content.cloneNode(true);
|
|
18
|
+
for (const element of content.querySelectorAll("[id]")) element.id += `-${side}`;
|
|
19
|
+
for (const element of content.querySelectorAll("[name]")) element.name += `-${side}`;
|
|
20
|
+
for (const attribute of ["for", "aria-describedby", "aria-labelledby", "aria-controls"]) {
|
|
21
|
+
for (const element of content.querySelectorAll(`[${attribute}]`)) {
|
|
22
|
+
element.setAttribute(attribute, element.getAttribute(attribute).split(/\s+/).map(id => `${id}-${side}`).join(" "));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
sample.append(content);
|
|
26
|
+
specimen.append(sample);
|
|
27
|
+
comparison.append(specimen);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const all = (selector, caseId) => document.querySelectorAll(`${caseId ? `#${caseId} ` : ""}${selector}`);
|
|
32
|
+
const status = (caseId, message) => { document.querySelector(`[data-status="${caseId}"]`).textContent = message; };
|
|
33
|
+
const setText = (selector, value, caseId) => { for (const element of all(selector, caseId)) element.textContent = value; };
|
|
34
|
+
|
|
35
|
+
document.getElementById("theme").addEventListener("change", event => {
|
|
36
|
+
document.documentElement.dataset.theme = event.target.value;
|
|
37
|
+
});
|
|
38
|
+
document.getElementById("sample-width").addEventListener("change", event => {
|
|
39
|
+
document.documentElement.style.setProperty("--sample-max", event.target.value === "narrow" ? "320px" : "100%");
|
|
40
|
+
});
|
|
41
|
+
document.getElementById("text-size").addEventListener("change", event => {
|
|
42
|
+
document.documentElement.style.fontSize = `${event.target.value}%`;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// C1: native arrow-key radio changes are mirrored without moving focus.
|
|
46
|
+
const planNames = { personal: "个人空间", team: "协作空间", archive: "档案空间" };
|
|
47
|
+
for (const input of all('input[type="radio"]', "c1")) {
|
|
48
|
+
input.addEventListener("change", event => {
|
|
49
|
+
if (event.target.name === "compact-kind") {
|
|
50
|
+
document.querySelector("[data-compact-result]").textContent = `当前筛选:${event.target.value}。此处没有值得展开为卡片的比较属性。`;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
for (const radio of all('.comparison input[type="radio"]', "c1")) radio.checked = radio.value === event.target.value;
|
|
54
|
+
status("c1", `当前选择:${planNames[event.target.value]}。两个版本已同步。`);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// C2: content changes together; unsupported wrapping falls back to normal text.
|
|
59
|
+
const copy = {
|
|
60
|
+
long: { title: "数据产权登记材料复核(第二批)与 API 调用说明", body: "发布前,请核对材料名称、授权范围与附件版本。API 调用说明和登记材料应当一起归档,便于后续查询。", file: "数据产权登记材料_第二批_授权范围与API调用说明_v2.1.0.pdf" },
|
|
61
|
+
short: { title: "登记材料复核", body: "发布前,请核对材料名称、授权范围与附件版本。", file: "登记材料清单.pdf" }
|
|
62
|
+
};
|
|
63
|
+
document.getElementById("copy-length").addEventListener("change", event => {
|
|
64
|
+
const next = copy[event.target.value];
|
|
65
|
+
for (const key of ["title", "body", "file"]) setText(`[data-copy-${key}]`, next[key], "c2");
|
|
66
|
+
});
|
|
67
|
+
status("c2", `本浏览器${CSS.supports("text-wrap", "balance") ? "支持" : "不支持"} text-wrap: balance;断点仍取决于真实字体和宽度。基础布局使用自然换行。`);
|
|
68
|
+
|
|
69
|
+
// C3: actual local updates, no fake network request or autoplay counter.
|
|
70
|
+
let count = 1111;
|
|
71
|
+
let loading = false;
|
|
72
|
+
const formatCount = new Intl.NumberFormat("zh-CN");
|
|
73
|
+
const amountSets = {
|
|
74
|
+
normal: ["¥12,345.67", "¥888.00", "¥1,111.00"],
|
|
75
|
+
edge: ["¥0.00", "−¥12.50", "—"],
|
|
76
|
+
long: ["¥123,456,789.50", "¥1,000,000.00", "¥99,888.00"]
|
|
77
|
+
};
|
|
78
|
+
function updateCounter() {
|
|
79
|
+
setText("[data-counter]", loading ? "读取中…" : formatCount.format(count), "c3");
|
|
80
|
+
for (const sample of all(".number-example", "c3")) sample.setAttribute("aria-busy", String(loading));
|
|
81
|
+
document.querySelector('[data-action="loading"]').setAttribute("aria-pressed", String(loading));
|
|
82
|
+
status("c3", `当前 ${formatCount.format(count)} 条;${loading ? "加载演示中,原数值保留" : "未加载"}。`);
|
|
83
|
+
}
|
|
84
|
+
document.querySelector('[data-action="increment"]').addEventListener("click", () => { count += 1; updateCounter(); });
|
|
85
|
+
document.querySelector('[data-action="cycle-count"]').addEventListener("click", () => { count = count === 1111 ? 8888 : count === 8888 ? 10000 : 1111; updateCounter(); });
|
|
86
|
+
document.querySelector('[data-action="loading"]').addEventListener("click", () => { loading = !loading; updateCounter(); });
|
|
87
|
+
document.getElementById("number-set").addEventListener("change", event => {
|
|
88
|
+
for (const cell of all("[data-amount]", "c3")) {
|
|
89
|
+
const value = amountSets[event.target.value][Number(cell.dataset.amount)];
|
|
90
|
+
cell.textContent = value;
|
|
91
|
+
if (value === "—") cell.setAttribute("aria-label", "暂无金额");
|
|
92
|
+
else cell.removeAttribute("aria-label");
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// C4: the same preference state is editable from either side.
|
|
97
|
+
let reminders = true;
|
|
98
|
+
let frequency = "每天";
|
|
99
|
+
function updatePreferences() {
|
|
100
|
+
for (const input of all("[data-reminders]", "c4")) input.checked = reminders;
|
|
101
|
+
for (const select of all("[data-frequency]", "c4")) select.value = frequency;
|
|
102
|
+
status("c4", `新评论提醒已${reminders ? "开启" : "关闭"};摘要频率:${frequency}。`);
|
|
103
|
+
}
|
|
104
|
+
for (const input of all("[data-reminders]", "c4")) input.addEventListener("change", event => { reminders = event.target.checked; updatePreferences(); });
|
|
105
|
+
for (const select of all("[data-frequency]", "c4")) select.addEventListener("change", event => { frequency = event.target.value; updatePreferences(); });
|
|
106
|
+
|
|
107
|
+
// C5: keep the interaction target while comparing the visible drawing.
|
|
108
|
+
document.getElementById("show-icon-guides").addEventListener("change", event => {
|
|
109
|
+
document.getElementById("c5").classList.toggle("show-icon-guides", event.target.checked);
|
|
110
|
+
});
|
|
111
|
+
let previewOpen = false;
|
|
112
|
+
for (const button of all('[data-action="preview"]', "c5")) {
|
|
113
|
+
button.addEventListener("click", () => {
|
|
114
|
+
// In a stacked comparison the mirrored panel above this control also
|
|
115
|
+
// expands. Keep the trigger the user just activated at its original height.
|
|
116
|
+
const previous = button.getBoundingClientRect();
|
|
117
|
+
const keepAnchor = document.activeElement === button && previous.top >= 0 && previous.bottom <= innerHeight;
|
|
118
|
+
previewOpen = !previewOpen;
|
|
119
|
+
for (const preview of all("[data-preview]", "c5")) preview.hidden = !previewOpen;
|
|
120
|
+
for (const control of all('[data-action="preview"]', "c5")) {
|
|
121
|
+
control.setAttribute("aria-label", `${previewOpen ? "关闭" : "打开"}季度归档清单预览`);
|
|
122
|
+
control.setAttribute("aria-expanded", String(previewOpen));
|
|
123
|
+
}
|
|
124
|
+
status("c5", previewOpen ? "已打开预览:3 份材料。再次激活同一按钮可关闭。" : "预览已关闭。两个版本已同步。");
|
|
125
|
+
if (keepAnchor) {
|
|
126
|
+
const shift = button.getBoundingClientRect().top - previous.top;
|
|
127
|
+
if (Math.abs(shift) > 1) window.scrollBy({ top: shift, behavior: "instant" });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// C6: one cancellable local operation shared by both forms. Restore invalidates
|
|
133
|
+
// pending completion so stale results cannot overwrite a reset.
|
|
134
|
+
let displayName = "归档助手";
|
|
135
|
+
let saveTimer;
|
|
136
|
+
let operation = 0;
|
|
137
|
+
let saving = false;
|
|
138
|
+
function setFeedback(message, isError = false) {
|
|
139
|
+
for (const feedback of all("[data-save-feedback]", "c6")) {
|
|
140
|
+
feedback.textContent = message;
|
|
141
|
+
feedback.classList.toggle("is-error", isError);
|
|
142
|
+
}
|
|
143
|
+
status("c6", message);
|
|
144
|
+
}
|
|
145
|
+
function setSaving(value) {
|
|
146
|
+
saving = value;
|
|
147
|
+
for (const form of all("form", "c6")) form.setAttribute("aria-busy", String(value));
|
|
148
|
+
for (const button of all("[data-save]", "c6")) {
|
|
149
|
+
// Temporary unavailability retains focus. The submit guard below enforces
|
|
150
|
+
// the state for pointer, keyboard and implicit form submissions alike.
|
|
151
|
+
button.setAttribute("aria-disabled", String(value));
|
|
152
|
+
button.textContent = value ? "正在保存…" : "保存更改";
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const input of all("[data-display-name]", "c6")) {
|
|
156
|
+
input.addEventListener("input", event => {
|
|
157
|
+
displayName = event.target.value;
|
|
158
|
+
for (const other of all("[data-display-name]", "c6")) {
|
|
159
|
+
if (other !== event.target) other.value = displayName;
|
|
160
|
+
other.removeAttribute("aria-invalid");
|
|
161
|
+
}
|
|
162
|
+
if (!saving) setFeedback("内容已更改,尚未保存。");
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
for (const form of all("form", "c6")) {
|
|
166
|
+
form.addEventListener("submit", event => {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
if (saving) return;
|
|
169
|
+
if (!displayName.trim()) {
|
|
170
|
+
for (const input of all("[data-display-name]", "c6")) input.setAttribute("aria-invalid", "true");
|
|
171
|
+
setFeedback("请输入显示名称,再保存更改。", true);
|
|
172
|
+
form.querySelector("[data-display-name]").focus();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const submittedName = displayName.trim();
|
|
176
|
+
const shouldFail = document.getElementById("save-outcome").value === "error";
|
|
177
|
+
const thisOperation = ++operation;
|
|
178
|
+
setSaving(true);
|
|
179
|
+
setFeedback("正在保存,输入内容已保留。也可以恢复示例来取消本次操作。");
|
|
180
|
+
saveTimer = setTimeout(() => {
|
|
181
|
+
if (thisOperation !== operation) return;
|
|
182
|
+
setSaving(false);
|
|
183
|
+
if (shouldFail) {
|
|
184
|
+
setFeedback("暂时无法保存,输入已保留。请重试。", true);
|
|
185
|
+
setText("[data-save]", "重试保存", "c6");
|
|
186
|
+
} else {
|
|
187
|
+
setFeedback(`已保存:${submittedName}${displayName.trim() !== submittedName ? "。当前输入另有未保存的修改" : ""}。`);
|
|
188
|
+
}
|
|
189
|
+
}, 800);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
for (const button of all('[data-action="reset-form"]', "c6")) {
|
|
193
|
+
button.addEventListener("click", () => {
|
|
194
|
+
operation += 1;
|
|
195
|
+
clearTimeout(saveTimer);
|
|
196
|
+
displayName = "归档助手";
|
|
197
|
+
for (const input of all("[data-display-name]", "c6")) { input.value = displayName; input.removeAttribute("aria-invalid"); }
|
|
198
|
+
setSaving(false);
|
|
199
|
+
setFeedback("已恢复示例内容;尚未保存。正在进行的保存已取消。");
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// C7: draw the actual 24 / 8 / 16 contour example; pills stay independent.
|
|
204
|
+
document.getElementById("show-radius-guides").addEventListener("change", event => {
|
|
205
|
+
document.getElementById("c7").classList.toggle("show-radius-guides", event.target.checked);
|
|
206
|
+
});
|
|
207
|
+
document.querySelector('#c7 [data-side="after"] [data-inner-arc]').setAttribute("d", "M8 24A16 16 0 0 1 24 8");
|
|
208
|
+
document.querySelector('#c7 [data-side="after"] [data-radius-values]').textContent = "外 R24 · 内缩 8 · 内 R16";
|
|
209
|
+
for (const button of all("[data-filter]", "c7")) {
|
|
210
|
+
button.addEventListener("click", event => {
|
|
211
|
+
const recent = event.currentTarget.dataset.filter === "recent";
|
|
212
|
+
for (const control of all("[data-filter]", "c7")) control.setAttribute("aria-pressed", String((control.dataset.filter === "recent") === recent));
|
|
213
|
+
setText("[data-filter-result]", recent ? "显示最近更新的 1 份材料。" : "显示全部 3 份材料。", "c7");
|
|
214
|
+
status("c7", `当前筛选:${recent ? "最近更新" : "全部"}。远离外角的筛选药丸保留独立形状。`);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// C8: retain input borders while the outer surface becomes quieter.
|
|
219
|
+
for (const input of all("[data-file-search]", "c8")) {
|
|
220
|
+
input.addEventListener("input", event => {
|
|
221
|
+
const query = event.target.value;
|
|
222
|
+
const normalized = query.trim().toLocaleLowerCase("zh-CN");
|
|
223
|
+
for (const other of all("[data-file-search]", "c8")) if (other !== event.target) other.value = query;
|
|
224
|
+
let matches = 0;
|
|
225
|
+
for (const side of all(".sample", "c8")) {
|
|
226
|
+
matches = 0;
|
|
227
|
+
for (const result of side.querySelectorAll("[data-document]")) {
|
|
228
|
+
const visible = result.textContent.toLocaleLowerCase("zh-CN").includes(normalized);
|
|
229
|
+
result.hidden = !visible;
|
|
230
|
+
if (visible) matches += 1;
|
|
231
|
+
}
|
|
232
|
+
side.querySelector("[data-empty-result]").hidden = matches !== 0;
|
|
233
|
+
}
|
|
234
|
+
status("c8", normalized ? `找到 ${matches} 份匹配文档。两个版本已同步。` : "显示全部 2 份文档。搜索会同步作用于两边。");
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN" data-theme="light">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="color-scheme" content="light dark">
|
|
7
|
+
<title>UI 细节微案例 · dev-ui-design</title>
|
|
8
|
+
<link rel="stylesheet" href="styles.css">
|
|
9
|
+
<script src="examples.js" defer></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<a class="skip-link" href="#cases">跳到案例</a>
|
|
13
|
+
<header class="page-header">
|
|
14
|
+
<p class="eyebrow">dev-ui-design · 原创教学样例</p>
|
|
15
|
+
<h1>把细节改到具体位置</h1>
|
|
16
|
+
<p class="intro">八组相同内容、相同功能的前后对照。观察一个局部关系,解释改变了什么,再检查它在真实状态中是否成立。</p>
|
|
17
|
+
<p class="resource-links"><a href="../../references/visual-refinement.md">精修方法</a><a href="../../references/layout-review.md">布局审查</a><a href="../../references/product-ui.md">产品 UI 验收</a></p>
|
|
18
|
+
<nav class="case-nav" aria-label="案例索引">
|
|
19
|
+
<a href="#c1">1 选择容器</a><a href="#c2">2 文字层级</a><a href="#c3">3 数字与状态</a><a href="#c4">4 分组留白</a><a href="#c5">5 图文对齐</a><a href="#c6">6 操作主次</a><a href="#c7">7 嵌套圆角</a><a href="#c8">8 表面边界</a>
|
|
20
|
+
</nav>
|
|
21
|
+
<div class="lab-controls" aria-label="对照环境">
|
|
22
|
+
<label>主题<select id="theme"><option value="light">浅色</option><option value="dark">深色</option></select></label>
|
|
23
|
+
<label>样例容器<select id="sample-width"><option value="fluid">随窗口</option><option value="narrow">最多 320px</option></select></label>
|
|
24
|
+
<label>文字大小<select id="text-size"><option value="100">100%</option><option value="200">200%</option></select></label>
|
|
25
|
+
</div>
|
|
26
|
+
<p class="environment-note">离线可用;操作只改变本页示例状态。字体为本机系统栈,图标为原创示意图,不冒充已加载 Geist 或 Reicon。实际字体、浏览器与缩放结果需在运行环境中核对。容器开关不等于真实设备测试。</p>
|
|
27
|
+
<noscript><p class="notice">启用 JavaScript 后可显示同步对照和操作示例。下面的方法说明仍可阅读。</p></noscript>
|
|
28
|
+
</header>
|
|
29
|
+
|
|
30
|
+
<main id="cases" class="case-list">
|
|
31
|
+
<section id="c1" class="case" aria-labelledby="c1-title">
|
|
32
|
+
<header class="case-header"><span class="case-number">案例 1</span><h2 id="c1-title">容器应当帮助比较</h2><p>少量选项需要同时比较容量与协作范围。调整后把同一属性放在可比较的位置,仍使用原生单选控件。</p></header>
|
|
33
|
+
<div class="comparison" data-case="c1"></div>
|
|
34
|
+
<p class="case-status" data-status="c1" role="status">当前选择:协作空间。任一版本的选择会同步到另一版本。</p>
|
|
35
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>选项容器、属性排列、选中边界;名称、容量、说明和行为相同。</dd></div><div><dt>适用与原因</dt><dd>少量、属性丰富的方案需要逐项比较。对齐属性比增加装饰更有帮助。</dd></div><div><dt>例外</dt><dd>只有短名称或选项很多时,保留紧凑列表。卡片不天然优于列表。</dd></div><div><dt>复验</dt><dd>用 Tab 进入单选组、方向键切换;检查两边一致,再缩窄容器。</dd></div></dl>
|
|
36
|
+
<details class="counterexample"><summary>反例:只有短名称时保留列表</summary><fieldset class="compact-options"><legend>按文档类型筛选</legend><label><input type="radio" name="compact-kind" value="全部" checked>全部</label><label><input type="radio" name="compact-kind" value="说明文档">说明文档</label><label><input type="radio" name="compact-kind" value="表格">表格</label><label><input type="radio" name="compact-kind" value="图片">图片</label></fieldset><p data-compact-result>当前筛选:全部。此处没有值得展开为卡片的比较属性。</p></details>
|
|
37
|
+
<template id="sample-c1"><fieldset class="plan-options"><legend>选择存储空间</legend><label class="plan"><input type="radio" name="plan" value="personal"><span class="plan-copy"><strong>个人空间</strong><span class="plan-size">10 GB</span><span class="plan-detail">个人整理与日常笔记</span></span></label><label class="plan"><input type="radio" name="plan" value="team" checked><span class="plan-copy"><strong>协作空间</strong><span class="plan-size">50 GB</span><span class="plan-detail">多人评论与资料复核</span></span></label><label class="plan"><input type="radio" name="plan" value="archive"><span class="plan-copy"><strong>档案空间</strong><span class="plan-size">200 GB</span><span class="plan-detail">长期归档与版本保留</span></span></label></fieldset></template>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<section id="c2" class="case" aria-labelledby="c2-title">
|
|
41
|
+
<header class="case-header"><span class="case-number">案例 2</span><h2 id="c2-title">文字层级不只靠字号</h2><p>保留相同文字角色和字号,通过字重、间隔与换行方式区分标题、正文和辅助信息。两边都保持可读的文字颜色。</p></header>
|
|
42
|
+
<div class="case-controls"><label>文案长度<select id="copy-length"><option value="long">长标题与混排</option><option value="short">短标题</option></select></label></div>
|
|
43
|
+
<div class="comparison" data-case="c2"></div>
|
|
44
|
+
<p class="case-status" data-status="c2">标题的 balance 是渐进增强;不支持时保留自然换行。实际断点随字体与容器变化。</p>
|
|
45
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>字重角色、标题与正文间隔、短标题的换行增强;不缩小辅助文字或改写内容。</dd></div><div><dt>适用与原因</dt><dd>全区都加粗时,重要信息反而不明确。标题和正文需要不同职责。</dd></div><div><dt>例外</dt><dd>海报的有意断行可以保留。中文不套用拉丁大写字形裁切,也不把 ch 当汉字数。</dd></div><div><dt>复验</dt><dd>切换长短文案与窄容器,检查中文标点、API 混排、文件名、200% 文字。</dd></div></dl>
|
|
46
|
+
<template id="sample-c2"><article class="type-example"><p class="type-meta">材料复核 · 待发布</p><h3 class="type-title" data-copy-title>数据产权登记材料复核(第二批)与 API 调用说明</h3><p class="type-body" data-copy-body>发布前,请核对材料名称、授权范围与附件版本。API 调用说明和登记材料应当一起归档,便于后续查询。</p><div class="type-file"><strong>附件名称</strong><p data-copy-file>数据产权登记材料_第二批_授权范围与API调用说明_v2.1.0.pdf</p></div><p class="type-help">更新于 2026-12-04。此时间为教学数据。</p></article></template>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
<section id="c3" class="case" aria-labelledby="c3-title">
|
|
50
|
+
<header class="case-header"><span class="case-number">案例 3</span><h2 id="c3-title">数字更新,邻近内容仍有位置</h2><p>动态计数保留自己的槽位;金额按同一格式比较。增加数字、切换边界数据或显示加载时,两边始终使用同一份状态。</p></header>
|
|
51
|
+
<div class="case-controls"><button type="button" data-action="increment">增加 1 条</button><button type="button" data-action="cycle-count">切换数字形状</button><button type="button" data-action="loading" aria-pressed="false">显示加载</button><label>金额数据<select id="number-set"><option value="normal">普通金额</option><option value="edge">零、负数与空值</option><option value="long">长金额</option></select></label></div>
|
|
52
|
+
<div class="comparison" data-case="c3"></div>
|
|
53
|
+
<p class="case-status" data-status="c3" role="status">当前 1,111 条;未加载。</p>
|
|
54
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>数值对齐、等宽数字与计数槽位;业务值、精度、列名和单位完全相同。</dd></div><div><dt>适用与原因</dt><dd>相邻数字需要比较,或数字变化不应推动邻近标签。等宽效果仍取决于本机字体。</dd></div><div><dt>例外</dt><dd>电话号码、版本号和正文不一律等宽。二维金额表可在本区域横向滚动;正文和文件名仍需重排。</dd></div><div><dt>复验</dt><dd>切换数字与加载,检查单位和完整精度。放大文字后 Tab 聚焦表格,用左右方向键查看全部金额。</dd></div></dl>
|
|
55
|
+
<template id="sample-c3"><div class="number-example"><p class="counter-line"><span class="counter-number" data-counter>1,111</span><span>条记录已归档</span></p><div class="amount-scroll" role="region" tabindex="0" aria-label="本批次费用表格" aria-describedby="amount-scroll-help"><table class="amount-table"><caption>本批次费用(教学数据)</caption><thead><tr><th scope="col">项目</th><th scope="col">金额</th></tr></thead><tbody><tr><th scope="row">材料整理</th><td data-amount="0">¥12,345.67</td></tr><tr><th scope="row">版本复核</th><td data-amount="1">¥888.00</td></tr><tr><th scope="row">附件归档</th><td data-amount="2">¥1,111.00</td></tr></tbody></table></div><p id="amount-scroll-help" class="amount-scroll-help">表格超出区域时可横向滚动。键盘:Tab 聚焦表格后按左右方向键;触摸:在表格内左右滑动。</p><p class="number-footnote">附件合计 <span class="value-unit">12.5 MB</span>;“—”表示暂无金额。</p><p class="filename">文件:登记材料_授权范围与API调用说明_完整归档版_v2.1.0.pdf</p></div></template>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
<section id="c4" class="case" aria-labelledby="c4-title">
|
|
59
|
+
<header class="case-header"><span class="case-number">案例 4</span><h2 id="c4-title">留白先表达归属,再表达宽松</h2><p>调整前所有间隔相近,组边界不够明确。调整后缩紧同一组、分开不同组,不把全部间距一起放大。</p></header>
|
|
60
|
+
<div class="comparison" data-case="c4"></div>
|
|
61
|
+
<p class="case-status" data-status="c4" role="status">新评论提醒已开启;摘要频率:每天。</p>
|
|
62
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>组内与组间间距;两边保留相同字段、字号、说明和操作。</dd></div><div><dt>适用与原因</dt><dd>标题需要靠近自己引出的内容。实际距离同时包含行框、padding 与 gap。</dd></div><div><dt>例外</dt><dd>经常扫描的文件列表需要密度;不能用放大每一行来证明精修。</dd></div><div><dt>复验</dt><dd>先说出字段归属,再看画面;切换提醒与频率,确认两边同步且说明不误归组。</dd></div></dl>
|
|
63
|
+
<details class="counterexample"><summary>反例:工作列表保留必要密度</summary><ul class="dense-list"><li><span>登记申请表.pdf</span><span>已复核</span></li><li><span>授权范围说明.md</span><span>待复核</span></li><li><span>材料版本清单.csv</span><span>已复核</span></li></ul><p>这些项目承担重复扫描任务。增加组外间隔,不代表每个文件行都应变成宽松卡片。</p></details>
|
|
64
|
+
<template id="sample-c4"><div class="spacing-example"><section class="setting-group"><h3>接收提醒</h3><p>关注与你参与的讨论有关的更新。</p><label class="check-row"><input type="checkbox" data-reminders checked>有新评论时提醒</label></section><section class="setting-group"><h3>摘要频率</h3><p>将多个更新汇总到一条摘要。</p><label class="field">发送频率<select data-frequency><option value="每天">每天</option><option value="每周">每周</option><option value="关闭">关闭</option></select></label></section></div></template>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
<section id="c5" class="case" aria-labelledby="c5-title">
|
|
68
|
+
<header class="case-header"><span class="case-number">案例 5</span><h2 id="c5-title">图标跟随首行,热区独立保留</h2><p>调整前图标居中于整段文字。调整后与预期首行关联;同一播放图形只在该组合中做很小的光学校正。</p></header>
|
|
69
|
+
<div class="case-controls"><label class="check-row"><input type="checkbox" id="show-icon-guides">显示图标框与按钮热区</label></div>
|
|
70
|
+
<div class="comparison" data-case="c5"></div>
|
|
71
|
+
<p class="case-status" data-status="c5" role="status">尚未打开预览。两个版本的预览按钮操作相同。</p>
|
|
72
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>行内对齐轴与播放路径的局部光学位置;保留 24px 图标框和 44px 按钮热区。</dd></div><div><dt>适用与原因</dt><dd>多行标题的前置图标应有明确归属。可见轮廓、布局框和热区是不同对象。</dd></div><div><dt>例外</dt><dd>单行工具栏可以垂直居中;这里的微调不能推广成所有播放图标统一偏移。</dd></div><div><dt>复验</dt><dd>缩窄后查看首行关系,开启框线,Tab 到预览按钮并按 Enter;热区不重叠。</dd></div></dl>
|
|
73
|
+
<template id="sample-c5"><div class="icon-example"><div class="document-row"><span class="icon-slot" aria-hidden="true"><svg viewBox="0 0 24 24" class="document-icon"><path d="M6 3h8l4 4v14H6z M14 3v5h4 M9 12h6 M9 16h6"/></svg></span><div class="document-copy"><h3>季度归档清单与版本复核说明</h3><p>请先核对文件范围,再打开预览。较长的说明继续属于同一个文档。</p></div><button type="button" class="icon-button" data-action="preview" aria-label="打开季度归档清单预览" aria-expanded="false" aria-controls="preview-content"><span class="icon-slot" aria-hidden="true"><svg viewBox="0 0 24 24" class="play-icon"><path d="M8 5 19 12 8 19Z"/></svg></span></button></div><div id="preview-content" class="preview-message" data-preview hidden><strong>季度归档清单</strong><p>示例包含 3 份材料,最后核对日期为 2026-12-04。</p></div></div></template>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section id="c6" class="case" aria-labelledby="c6-title">
|
|
77
|
+
<header class="case-header"><span class="case-number">案例 6</span><h2 id="c6-title">同一任务组,需要清楚的下一步</h2><p>两个动作都真实可用。调整后仅弱化“恢复示例”的视觉权重;保存期间、出错与重试仍沿用同一关系。</p></header>
|
|
78
|
+
<div class="case-controls"><label>下一次保存结果<select id="save-outcome"><option value="success">成功</option><option value="error">模拟失败</option></select></label><p>保存延迟约 0.8 秒。期间按钮暂不可重复提交,仍保留焦点;不发送网络请求。</p></div>
|
|
79
|
+
<div class="comparison" data-case="c6"></div>
|
|
80
|
+
<p class="case-status" data-status="c6" role="status">尚未保存。两边的输入、结果与恢复操作保持同步。</p>
|
|
81
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>恢复按钮的变体;文案、顺序、命中区域、焦点、校验和保存行为不变。</dd></div><div><dt>适用与原因</dt><dd>当前任务是保存修改,恢复示例是次操作。无需让两者同时争夺注意。</dd></div><div><dt>例外</dt><dd>独立任务区可以各有主操作。不能为简洁隐藏重要行为或删除按钮名称。</dd></div><div><dt>复验</dt><dd>测试空输入、Tab、Enter、失败重试与保存中恢复。连续提交只启动一次操作;主动移焦后,完成回调不抢回焦点。</dd></div></dl>
|
|
82
|
+
<template id="sample-c6"><form class="action-example" novalidate><label class="field" for="display-name">显示名称<input id="display-name" data-display-name type="text" value="归档助手" required maxlength="80" autocomplete="off" aria-describedby="name-help save-feedback"></label><p id="name-help" class="field-help">用于识别这份配置,最多 80 个字符。</p><div class="action-row"><button type="submit" class="primary" data-save aria-disabled="false">保存更改</button><button type="button" class="reset-action" data-action="reset-form">恢复示例</button></div><p id="save-feedback" class="save-feedback" data-save-feedback>尚未保存。</p></form></template>
|
|
83
|
+
</section>
|
|
84
|
+
|
|
85
|
+
<section id="c7" class="case" aria-labelledby="c7-title">
|
|
86
|
+
<header class="case-header"><span class="case-number">案例 7</span><h2 id="c7-title">紧邻圆角,先说清测量端点</h2><p>外轮廓半径 24px,内轮廓相对外轮廓内缩 8px(1px 边框 + 7px padding)。该紧邻转角的内半径候选为 16px。</p></header>
|
|
87
|
+
<div class="case-controls"><label class="check-row"><input type="checkbox" id="show-radius-guides">显示左上角的轮廓与内缩标记</label></div>
|
|
88
|
+
<div class="comparison" data-case="c7"></div>
|
|
89
|
+
<p class="case-status" data-status="c7" role="status">当前筛选:全部。远离外角的筛选药丸保留独立形状。</p>
|
|
90
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>紧邻内表面的圆角由 24px 调整为 16px;外半径和轮廓间距不变。</dd></div><div><dt>适用与原因</dt><dd>两条对应轮廓需要近似同心。数字来自本案例的明确几何关系。</dd></div><div><dt>例外</dt><dd>下方独立筛选药丸不沿外框做减法。不同曲率、较远控件也不强制同心。</dd></div><div><dt>复验</dt><dd>开标记对照实际轮廓,缩窄后检查内容与裁切;Tab 到药丸,焦点环不被剪掉。</dd></div></dl>
|
|
91
|
+
<template id="sample-c7"><div class="radius-example"><div class="radius-shell"><div class="radius-inner"><strong>材料归档</strong><p>本次共 3 份材料,保留完整版本记录。</p></div><svg class="radius-guide" aria-hidden="true" viewBox="0 0 104 72"><path class="outer-arc" d="M0 24A24 24 0 0 1 24 0"/><path class="inner-arc" data-inner-arc d="M8 32A24 24 0 0 1 32 8"/><path d="M0 42H8 M0 38V46 M8 38V46"/><text x="14" y="46">内缩 8px</text><text x="42" y="15">外 R24</text></svg></div><p class="radius-values" data-radius-values>外 R24 · 内缩 8 · 内 R24</p><div class="pill-row" role="group" aria-label="归档筛选"><button type="button" class="pill" data-filter="all" aria-pressed="true">全部</button><button type="button" class="pill" data-filter="recent" aria-pressed="false">最近更新</button></div><p data-filter-result>显示全部 3 份材料。</p></div></template>
|
|
92
|
+
</section>
|
|
93
|
+
|
|
94
|
+
<section id="c8" class="case" aria-labelledby="c8-title">
|
|
95
|
+
<header class="case-header"><span class="case-number">案例 8</span><h2 id="c8-title">边界各有任务,不重复加重</h2><p>外层不再同时叠加强边框和明显阴影。白底封面的边缘按需补出;输入框仍保留辨认所需的边界。</p></header>
|
|
96
|
+
<div class="comparison" data-case="c8"></div>
|
|
97
|
+
<p class="case-status" data-status="c8" role="status">显示全部 2 份文档。搜索会同步作用于两边。</p>
|
|
98
|
+
<dl class="case-notes"><div><dt>只改</dt><dd>外层边界与阴影强度、媒体内收边缘;图片、文案、输入框和搜索结果一致。</dd></div><div><dt>适用与原因</dt><dd>内容分组、媒体边缘和输入控件边界承担不同任务,不需要同样显著。</dd></div><div><dt>例外</dt><dd>保留必要的输入边框;不全局给透明 logo 或全出血图片加轮廓。强制颜色模式保留系统边界。</dd></div><div><dt>复验</dt><dd>搜索“授权”与无结果文本;切换主题和强制颜色,检查图片、输入框与结果边界。</dd></div></dl>
|
|
99
|
+
<template id="sample-c8"><div class="surface-example"><article class="depth-card"><div class="media-frame"><svg class="document-cover" viewBox="0 0 320 150" role="img" aria-labelledby="cover-title"><title id="cover-title">白底归档文档封面的原创示意图</title><rect width="320" height="150" fill="#fff"/><rect x="24" y="24" width="108" height="8" rx="2" fill="#2d343b"/><rect x="24" y="44" width="70" height="4" rx="2" fill="#5a6570"/><path d="M228 32h38l22 22v64h-60z M266 32v24h22 M240 76h34 M240 88h34 M240 100h22" fill="none" stroke="#607080" stroke-width="2"/><path d="M24 94h132 M24 107h104 M24 120h120" stroke="#b9c2ca" stroke-width="3"/></svg></div><h3>季度归档简报</h3><p>集中查看申请、授权范围与版本记录。</p><label class="field" for="file-search">查找文件<input id="file-search" type="search" data-file-search placeholder="例如:授权" autocomplete="off"></label><ul class="document-results"><li data-document="登记申请表">登记申请表.pdf</li><li data-document="授权范围说明">授权范围说明.md</li></ul><p class="empty-result" data-empty-result hidden>没有匹配文件。请修改或清空关键词。</p></article></div></template>
|
|
100
|
+
</section>
|
|
101
|
+
</main>
|
|
102
|
+
<footer class="page-footer"><p>用这些样例检查判断过程,不把它们复制为业务页面皮肤。调整前保留可用性,调整后也不代表所有项目的唯一答案。</p><p><a href="../../references/visual-refinement.md">返回细节精修方法</a> · <a href="../../references/minimal-style.md">查看项目现有预设</a></p></footer>
|
|
103
|
+
</body>
|
|
104
|
+
</html>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
--page: #f6f7f8;
|
|
4
|
+
--surface: #fff;
|
|
5
|
+
--subtle: #f0f2f4;
|
|
6
|
+
--text: #181818;
|
|
7
|
+
--muted: #545c65;
|
|
8
|
+
--line: #cbd0d6;
|
|
9
|
+
--control-line: #747c86;
|
|
10
|
+
--accent: #245b9b;
|
|
11
|
+
--accent-soft: #edf4fc;
|
|
12
|
+
--accent-text: #173f6e;
|
|
13
|
+
--on-accent: #fff;
|
|
14
|
+
--error: #a32c27;
|
|
15
|
+
--shadow: rgb(24 35 48 / 14%);
|
|
16
|
+
--sample-max: 100%;
|
|
17
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "PingFang TC", "Noto Sans CJK SC", "Noto Sans CJK TC", sans-serif;
|
|
18
|
+
font-size: 100%;
|
|
19
|
+
line-height: 1.6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:root[data-theme="dark"] {
|
|
23
|
+
color-scheme: dark;
|
|
24
|
+
--page: #15181d;
|
|
25
|
+
--surface: #1e232a;
|
|
26
|
+
--subtle: #282e36;
|
|
27
|
+
--text: #f0f2f5;
|
|
28
|
+
--muted: #bec5ce;
|
|
29
|
+
--line: #505b68;
|
|
30
|
+
--control-line: #8c98a7;
|
|
31
|
+
--accent: #a4c8f5;
|
|
32
|
+
--accent-soft: #263c57;
|
|
33
|
+
--accent-text: #d4e7ff;
|
|
34
|
+
--on-accent: #152d48;
|
|
35
|
+
--error: #ffb2ab;
|
|
36
|
+
--shadow: rgb(0 0 0 / 38%);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
* { box-sizing: border-box; }
|
|
40
|
+
body { margin: 0; color: var(--text); background: var(--page); }
|
|
41
|
+
[hidden] { display: none !important; }
|
|
42
|
+
button, input, select { font: inherit; color: inherit; }
|
|
43
|
+
input::placeholder { color: var(--muted); opacity: 1; }
|
|
44
|
+
button, select, input:not([type="radio"]):not([type="checkbox"]) {
|
|
45
|
+
max-inline-size: 100%;
|
|
46
|
+
min-block-size: 44px;
|
|
47
|
+
border: 1px solid var(--control-line);
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
background: var(--surface);
|
|
50
|
+
}
|
|
51
|
+
button { padding: 8px 16px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
|
|
52
|
+
select, input:not([type="radio"]):not([type="checkbox"]) { padding: 8px 12px; min-inline-size: 0; }
|
|
53
|
+
button:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--subtle); }
|
|
54
|
+
button:disabled, button[aria-disabled="true"] { cursor: wait; color: var(--muted); background: var(--subtle); border-style: dashed; }
|
|
55
|
+
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
|
|
56
|
+
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
|
|
57
|
+
input[type="radio"], input[type="checkbox"] { flex: 0 0 auto; inline-size: 18px; block-size: 18px; margin: 3px 0 0; accent-color: var(--accent); }
|
|
58
|
+
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
|
|
59
|
+
h1, h2, h3, p { margin: 0; }
|
|
60
|
+
h1, h2 { font-size: 1.125rem; line-height: 1.5; font-weight: 600; }
|
|
61
|
+
h3 { font-size: 1rem; line-height: 1.6; font-weight: 600; }
|
|
62
|
+
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
63
|
+
legend { padding: 0; margin-block-end: 16px; font-weight: 600; }
|
|
64
|
+
ul { margin: 0; padding-inline-start: 20px; }
|
|
65
|
+
svg { display: block; max-inline-size: 100%; }
|
|
66
|
+
.skip-link { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; padding: 12px; background: var(--surface); z-index: 1; transform: translateY(-160%); }
|
|
67
|
+
.skip-link:focus { transform: none; }
|
|
68
|
+
.page-header, .case-list, .page-footer { max-inline-size: 1160px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 32px); }
|
|
69
|
+
.page-header { padding-block: 40px 24px; }
|
|
70
|
+
.eyebrow, .case-number { color: var(--muted); font-size: .875rem; }
|
|
71
|
+
.page-header h1 { margin-block: 8px; }
|
|
72
|
+
.intro { max-inline-size: 56rem; }
|
|
73
|
+
.resource-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-block: 16px 24px; }
|
|
74
|
+
.case-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-block: 16px; border-block: 1px solid var(--line); }
|
|
75
|
+
.case-nav a { display: inline-flex; align-items: center; min-block-size: 32px; }
|
|
76
|
+
.lab-controls, .case-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
|
|
77
|
+
.lab-controls { margin-block: 24px 12px; }
|
|
78
|
+
.lab-controls > label, .case-controls > label:not(.check-row) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
79
|
+
.environment-note, .field-help, .case-status, .case-controls > p { color: var(--muted); font-size: .875rem; }
|
|
80
|
+
.environment-note { max-inline-size: 62rem; }
|
|
81
|
+
.notice { margin-block-start: 16px; padding: 16px; border: 1px solid var(--control-line); }
|
|
82
|
+
.case { padding-block: 32px 40px; border-block-start: 1px solid var(--line); scroll-margin-block-start: 16px; }
|
|
83
|
+
.case-header h2 { margin-block: 4px 8px; }
|
|
84
|
+
.case-header > p { max-inline-size: 56rem; }
|
|
85
|
+
.case-controls { margin-block: 20px; }
|
|
86
|
+
.case-controls > p { flex: 1 1 20rem; }
|
|
87
|
+
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-block-start: 24px; }
|
|
88
|
+
.specimen { min-inline-size: 0; }
|
|
89
|
+
.specimen-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-block-end: 8px; }
|
|
90
|
+
.specimen-heading h3 { font-size: .875rem; font-weight: 600; }
|
|
91
|
+
.specimen-heading span { color: var(--muted); font-size: .875rem; }
|
|
92
|
+
.sample { inline-size: 100%; max-inline-size: var(--sample-max); min-inline-size: 0; margin-inline: auto; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
|
|
93
|
+
.sample p, .sample h3, .sample strong, .sample li, .sample td, .sample th { overflow-wrap: anywhere; }
|
|
94
|
+
.case-status { margin-block-start: 12px; }
|
|
95
|
+
.case-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; margin-block: 24px 0; }
|
|
96
|
+
.case-notes > div { min-inline-size: 0; }
|
|
97
|
+
.case-notes dt { font-size: .875rem; font-weight: 600; margin-block-end: 4px; }
|
|
98
|
+
.case-notes dd { margin: 0; font-size: .875rem; color: var(--muted); }
|
|
99
|
+
.counterexample { margin-block-start: 24px; border-block-start: 1px solid var(--line); padding-block-start: 16px; }
|
|
100
|
+
summary { cursor: pointer; font-weight: 600; padding-block: 8px; }
|
|
101
|
+
.counterexample > p { margin-block-start: 12px; color: var(--muted); font-size: .875rem; }
|
|
102
|
+
.compact-options { margin-block-start: 16px; max-inline-size: 32rem; }
|
|
103
|
+
.compact-options legend { margin-block-end: 4px; }
|
|
104
|
+
.compact-options label, .check-row { display: flex; align-items: start; gap: 8px; min-block-size: 44px; padding-block: 8px; }
|
|
105
|
+
.page-footer { padding-block: 24px 40px; border-block-start: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
|
|
106
|
+
.page-footer p + p { margin-block-start: 12px; }
|
|
107
|
+
|
|
108
|
+
/* C1: one native radio group per side; only the visual organization differs. */
|
|
109
|
+
.plan-options { display: grid; gap: 8px; }
|
|
110
|
+
.plan { display: flex; align-items: start; gap: 12px; min-inline-size: 0; padding: 12px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
|
|
111
|
+
.plan-copy { display: flex; flex-wrap: wrap; gap: 4px 12px; min-inline-size: 0; }
|
|
112
|
+
.plan-size { font-variant-numeric: tabular-nums; }
|
|
113
|
+
.plan-detail { color: var(--muted); font-size: .875rem; }
|
|
114
|
+
.plan:has(input:checked) { background: var(--accent-soft); }
|
|
115
|
+
.plan:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
116
|
+
.sample--after .plan { border-color: var(--line); }
|
|
117
|
+
.sample--after .plan:has(input:checked) { border-color: var(--accent); }
|
|
118
|
+
.sample--after .plan-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; inline-size: 100%; }
|
|
119
|
+
.sample--after .plan-detail { grid-column: 1 / -1; }
|
|
120
|
+
|
|
121
|
+
/* C2: no smaller type or faded text is used to manufacture the comparison. */
|
|
122
|
+
.type-example > * + * { margin-block-start: 16px; }
|
|
123
|
+
.type-title { font-size: 1.125rem; font-weight: 600; }
|
|
124
|
+
.type-body { font-size: 1rem; }
|
|
125
|
+
.type-meta, .type-help, .type-file { font-size: .875rem; }
|
|
126
|
+
.type-meta, .type-help { color: var(--muted); }
|
|
127
|
+
.sample--before .type-example { font-weight: 600; }
|
|
128
|
+
.type-file p { margin-block-start: 8px; }
|
|
129
|
+
.sample--after .type-title { text-wrap: balance; }
|
|
130
|
+
.sample--after .type-body { font-weight: 400; text-wrap: pretty; margin-block-start: 8px; }
|
|
131
|
+
.sample--after .type-meta { font-weight: 500; }
|
|
132
|
+
.sample--after .type-file { margin-block-start: 24px; }
|
|
133
|
+
.sample--after .type-help { font-weight: 400; }
|
|
134
|
+
|
|
135
|
+
/* C3: tabular figures alone cannot reserve space when the number of digits changes. */
|
|
136
|
+
.counter-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-block-end: 24px; }
|
|
137
|
+
.counter-number { font-size: 1.125rem; font-weight: 600; }
|
|
138
|
+
.amount-scroll { min-inline-size: 0; max-inline-size: 100%; overflow-x: auto; }
|
|
139
|
+
.amount-table { inline-size: 100%; table-layout: auto; border-collapse: collapse; }
|
|
140
|
+
.amount-table caption { text-align: start; color: var(--muted); font-size: .875rem; margin-block-end: 8px; }
|
|
141
|
+
.amount-table th, .amount-table td { padding: 8px 4px; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; font-weight: 400; white-space: nowrap; overflow-wrap: normal; }
|
|
142
|
+
.amount-table thead th { font-weight: 600; }
|
|
143
|
+
.amount-scroll-help { margin-block-start: 12px; color: var(--muted); font-size: .875rem; }
|
|
144
|
+
.number-footnote, .filename { font-size: .875rem; color: var(--muted); margin-block-start: 16px; }
|
|
145
|
+
.value-unit { display: inline-block; white-space: nowrap; }
|
|
146
|
+
.sample--after .counter-number { min-inline-size: 7ch; text-align: end; font-variant-numeric: tabular-nums; }
|
|
147
|
+
.sample--after .amount-table td { text-align: end; font-variant-numeric: tabular-nums; }
|
|
148
|
+
.sample--after .amount-table thead th:last-child { text-align: end; }
|
|
149
|
+
|
|
150
|
+
/* C4: distinguish groups without inflating every row. */
|
|
151
|
+
.spacing-example { display: grid; gap: 16px; }
|
|
152
|
+
.setting-group { display: grid; gap: 16px; }
|
|
153
|
+
.setting-group > p { color: var(--muted); font-size: .875rem; }
|
|
154
|
+
.field { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-inline-size: 0; }
|
|
155
|
+
.sample--after .spacing-example { gap: 32px; }
|
|
156
|
+
.sample--after .setting-group { gap: 8px; }
|
|
157
|
+
.dense-list { list-style: none; padding: 0; max-inline-size: 40rem; margin-block-start: 12px; }
|
|
158
|
+
.dense-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-block: 8px; border-block-end: 1px solid var(--line); }
|
|
159
|
+
.dense-list li > span:first-child { overflow-wrap: anywhere; }
|
|
160
|
+
.dense-list li > span:last-child { color: var(--muted); }
|
|
161
|
+
|
|
162
|
+
/* C5: the 44px control is independent from the 24px icon slot and 18px drawing. */
|
|
163
|
+
.document-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px; gap: 12px; align-items: center; }
|
|
164
|
+
.icon-slot { display: grid; place-items: center; inline-size: 24px; block-size: 24px; flex: 0 0 auto; }
|
|
165
|
+
.icon-slot svg { inline-size: 18px; block-size: 18px; }
|
|
166
|
+
.document-icon { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
|
|
167
|
+
.play-icon { fill: currentColor; }
|
|
168
|
+
.icon-button { display: grid; place-items: center; inline-size: 44px; min-block-size: 44px; padding: 0; }
|
|
169
|
+
.document-copy p { margin-block-start: 8px; color: var(--muted); font-size: .875rem; }
|
|
170
|
+
.sample--after .document-row { align-items: start; }
|
|
171
|
+
.sample--after .document-row > .icon-slot { margin-block-start: max(0px, calc((1.6em - 24px) / 2)); }
|
|
172
|
+
.sample--after .play-icon path { transform: translateX(.5px); }
|
|
173
|
+
.show-icon-guides .icon-slot { outline: 1px dashed var(--accent); outline-offset: 0; }
|
|
174
|
+
.show-icon-guides .icon-button { border-style: dashed; }
|
|
175
|
+
.preview-message { margin-block-start: 20px; padding: 16px; border-inline-start: 3px solid var(--accent); background: var(--subtle); }
|
|
176
|
+
.preview-message p { margin-block-start: 4px; }
|
|
177
|
+
|
|
178
|
+
/* C6: identical actions; only the recovery action's emphasis changes. */
|
|
179
|
+
.action-example { display: grid; gap: 16px; }
|
|
180
|
+
.field-help { margin-block-start: -8px; }
|
|
181
|
+
.action-row { display: flex; flex-wrap: wrap; gap: 12px; }
|
|
182
|
+
.primary, .sample--before .reset-action { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
|
|
183
|
+
.primary:hover:not(:disabled):not([aria-disabled="true"]), .sample--before .reset-action:hover { color: var(--on-accent); background: var(--accent); outline: 1px solid var(--accent); outline-offset: 1px; }
|
|
184
|
+
.primary:disabled, .primary[aria-disabled="true"] { color: var(--muted); background: var(--subtle); border-color: var(--control-line); }
|
|
185
|
+
.save-feedback { color: var(--muted); min-block-size: 3.2em; }
|
|
186
|
+
.save-feedback.is-error { color: var(--error); }
|
|
187
|
+
[aria-invalid="true"] { border-color: var(--error) !important; }
|
|
188
|
+
|
|
189
|
+
/* C7: the border and padding total an 8px inset from the outer contour. */
|
|
190
|
+
.radius-shell { position: relative; border: 1px solid var(--accent); padding: 7px; border-radius: 24px; background: var(--accent-soft); }
|
|
191
|
+
.radius-inner { border-radius: 24px; padding: 24px; color: var(--accent-text); background: var(--surface); border: 1px solid var(--line); }
|
|
192
|
+
.radius-inner > p { margin-block-start: 8px; }
|
|
193
|
+
.sample--after .radius-inner { border-radius: 16px; }
|
|
194
|
+
.radius-guide { display: none; position: absolute; inset-block-start: -1px; inset-inline-start: -1px; inline-size: 104px; block-size: 72px; overflow: visible; pointer-events: none; }
|
|
195
|
+
.radius-guide path { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 2; }
|
|
196
|
+
.radius-guide text { fill: var(--accent-text); font-size: 10px; paint-order: stroke; stroke: var(--surface); stroke-width: 3; }
|
|
197
|
+
.show-radius-guides .radius-guide { display: block; }
|
|
198
|
+
.radius-values { margin-block-start: 12px; color: var(--muted); font-size: .875rem; }
|
|
199
|
+
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 24px 8px; }
|
|
200
|
+
.pill { border-radius: 999px; }
|
|
201
|
+
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
|
|
202
|
+
|
|
203
|
+
/* C8: structural borders and media edges are independent from elevation. */
|
|
204
|
+
.depth-card { padding: 16px; border: 2px solid var(--control-line); border-radius: 12px; box-shadow: 0 4px 12px var(--shadow); }
|
|
205
|
+
.media-frame { position: relative; background: #fff; border-radius: 8px; overflow: hidden; }
|
|
206
|
+
.document-cover { inline-size: 100%; block-size: auto; }
|
|
207
|
+
.depth-card h3 { margin-block: 16px 8px; }
|
|
208
|
+
.depth-card > p { color: var(--muted); font-size: .875rem; }
|
|
209
|
+
.depth-card .field { margin-block-start: 20px; }
|
|
210
|
+
.document-results { list-style: none; padding: 0; margin-block-start: 16px; }
|
|
211
|
+
.document-results li { padding-block: 8px; border-block-end: 1px solid var(--line); }
|
|
212
|
+
.empty-result { margin-block-start: 16px; }
|
|
213
|
+
.sample--after .depth-card { border: 1px solid var(--line); padding: 17px; box-shadow: none; }
|
|
214
|
+
.sample--after .media-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(24 35 48 / 24%); pointer-events: none; }
|
|
215
|
+
|
|
216
|
+
@media (max-width: 800px) {
|
|
217
|
+
.comparison { grid-template-columns: minmax(0, 1fr); gap: 20px; }
|
|
218
|
+
.case-notes { grid-template-columns: minmax(0, 1fr); gap: 16px; }
|
|
219
|
+
}
|
|
220
|
+
@media (max-width: 440px) {
|
|
221
|
+
.sample { padding: 16px; }
|
|
222
|
+
.page-header { padding-block-start: 24px; }
|
|
223
|
+
.sample--after .plan-copy { grid-template-columns: minmax(0, 1fr); }
|
|
224
|
+
.sample--after .plan-detail { grid-column: auto; }
|
|
225
|
+
.document-row { gap: 8px; }
|
|
226
|
+
.radius-inner { padding: 16px; }
|
|
227
|
+
.depth-card { padding: 12px; }
|
|
228
|
+
.sample--after .depth-card { padding: 13px; }
|
|
229
|
+
}
|
|
230
|
+
@media (prefers-reduced-motion: reduce) {
|
|
231
|
+
*, *::before, *::after { scroll-behavior: auto !important; }
|
|
232
|
+
}
|
|
233
|
+
@media (forced-colors: active) {
|
|
234
|
+
:root { --page: Canvas; --surface: Canvas; --subtle: Canvas; --text: CanvasText; --muted: CanvasText; --line: CanvasText; --control-line: ButtonText; --accent: Highlight; --accent-soft: Canvas; --accent-text: CanvasText; --on-accent: HighlightText; --error: CanvasText; }
|
|
235
|
+
.sample, .depth-card, .plan, .radius-shell, .radius-inner { box-shadow: none; border-color: CanvasText; }
|
|
236
|
+
.plan:has(input:checked), .pill[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: 1px; }
|
|
237
|
+
#c6 .action-row button, #c6 .action-row button:hover { color: ButtonText; background: ButtonFace; border-color: ButtonText; }
|
|
238
|
+
#c6 .action-row button:focus-visible { outline: 3px solid Highlight; outline-offset: 3px; }
|
|
239
|
+
button:disabled, button[aria-disabled="true"], #c6 .action-row button:disabled, #c6 .action-row button[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
|
|
240
|
+
.sample--after .media-frame::after { box-shadow: none; border: 1px solid CanvasText; }
|
|
241
|
+
.save-feedback.is-error { text-decoration: underline; }
|
|
242
|
+
}
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
切换、筛选、编辑替换使用最后有效意图。增加、批量修改按业务顺序和幂等规则保留每次有效操作。自动保存必须核对真实持久化与旧响应晚到,模拟界面明确证据边界。涉及动画中断时读[状态变化方法](motion.md)。
|
|
17
17
|
|
|
18
|
+
异步操作结束时保留用户当下的位置,不凭 `document.activeElement === document.body` 推断应恢复提交按钮的焦点:用户可能已主动点击正文。沿用组件已有禁用机制;若短暂忙碌需要保留按钮焦点,可用 `aria-disabled` 表达不可用,并在实际处理器拦截重复操作,不能只改外观。分别验证键盘提交后留在原位、等待中切到别处、点击非聚焦内容,以及取消后旧响应晚到的路径。
|
|
19
|
+
|
|
18
20
|
## 显露次要操作
|
|
19
21
|
|
|
20
22
|
桌面指针进入行或操作区时可显露次要按钮,键盘用 focus/focus-within 显露,焦点仍在组内时保持可见。为操作预留固定槽位或稳定的“更多”入口。检查按钮出现后文本起点、行高和原目标的位置,验证透明控件没有意外进入 Tab 顺序或接收点击。触摸用户有可见可点的入口。滚动接近只预备当前区域,保持焦点及业务状态。
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
必要的小光学偏移之前,先统一同级控件尺寸和槽位;验证可比较的用法。保留可用且不重叠的命中目标,不通过 transform 掩盖父布局不一致。透明命中内边距可以超过绘制图标槽位;收紧操作组后检查相邻目标边缘。
|
|
33
33
|
|
|
34
|
+
用[多行图标案例](../assets/visual-refinement/index.html#c5)区分首行关联、文字列与可点击区域。辅助说明沿所属文本列起始;若退回图标列,应能说明这是另一组内容,而不是嵌套容器漏了槽位。
|
|
35
|
+
|
|
34
36
|
## 先识别分组,再选择间隙
|
|
35
37
|
|
|
36
38
|
按同一对象、动作或重复单元分组,不按 DOM 同级、背景或 React 组件分组。定位前先陈述关系。独立检查每个嵌套层级;外部间隔更大,不要求内部间隔也更大。
|
|
@@ -47,6 +49,38 @@
|
|
|
47
49
|
|
|
48
50
|
复用项目间距 token,校准时保持选定的对齐轴。该分组方法独立于数字尺度。
|
|
49
51
|
|
|
52
|
+
[分组留白案例](../assets/visual-refinement/index.html#c4)用相同内容对比标题归属。也检查相反问题:给文件列表每行增加大量留白会降低比较密度,即使所有间距都在 token 表中,也不表示符合任务。
|
|
53
|
+
|
|
54
|
+
## 检查中文与混排换行
|
|
55
|
+
|
|
56
|
+
先看当前宽度、真实字体、字号与行高,再选择换行行为。沿用项目的语言标记,分别试排简体、繁体、中文标点、英文长词和文件名。连续正文使用适合阅读的行宽;`ch` 基于数字字形的宽度,不等于中文字数。
|
|
57
|
+
|
|
58
|
+
| 内容 | 处理与核对 | 适用边界 |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| 短标题 | 先调整现有内容宽度与文字角色;确有孤立短行时可定向试用 `text-wrap: balance` | 核对目标浏览器与实际换行。它不缩小容器,带可见底色的标签可能留下更多空白。 |
|
|
61
|
+
| 连续正文 | 使用无单位行高,按任务限制阅读宽度;末行零碎时可定向试用 `text-wrap: pretty` | 保留不支持时的普通换行。不要为一段更整齐而给全部节点增加排版计算。 |
|
|
62
|
+
| 中文与标点 | 在声明的语言下检查行首行尾、成对标点和中西混排 | 先用浏览器正常断行;字距、`line-break` 等调整须以实际目标语言和浏览器结果为依据。 |
|
|
63
|
+
| URL、长文件名或标识符 | 给可收缩列 `min-width: 0`,在该文本范围按需要用 `overflow-wrap: anywhere` | 重要名称优先完整显示或有可达的展开路径,避免全站 `word-break: break-all` 破坏普通阅读。 |
|
|
64
|
+
| 字段标签、按钮与说明 | 允许预期的多行,优先最小高度与内容撑开 | 文字放大后仍保留操作。只在业务确需且有替代布局的局部使用不换行。 |
|
|
65
|
+
|
|
66
|
+
手工 `<br>` 只用于内容本身需要的分行,不能为当前截图固定标题断点。对相同标题替换长短内容,再改变窗口,检查标点、末行、相邻控件及下方内容是否仍清楚。
|
|
67
|
+
|
|
68
|
+
`text-box` 等字体度量修剪只作有目标环境依据的局部增强。拉丁大写高度与基线不能代替中文实际字形的边缘。使用前按目标字体、语言与浏览器试排;属性被忽略时,基础行高与布局仍须可用。多行正文不因追求边缘齐平而丢掉阅读所需的行距。
|
|
69
|
+
|
|
70
|
+
在[文字层级与断行案例](../assets/visual-refinement/index.html#c2)检查同文案的窄屏变化。调整字重与留白解决的问题不必同时更换字体或加大标题。
|
|
71
|
+
|
|
72
|
+
## 保持数字与单位稳定
|
|
73
|
+
|
|
74
|
+
先区分可比较数据、实时计数与普通叙述。金额或数据列需要跨行比较时,核对已有数值格式,按需要使用 `font-variant-numeric: tabular-nums`,并确认实际字体支持。它固定数字字形宽度,不会自动对齐小数点、单位或整个容器。
|
|
75
|
+
|
|
76
|
+
重复数值按项目列结构对齐。小数位和货币格式沿用业务语义,不能为画面整齐擅自补改精度。动态计数按真实范围预留合适槽位,例如检查 9、10、99、100 与实际最大长度,避免以固定小宽度裁切更长数值。电话号码、版本号和叙述正文不因包含数字就统一改成等宽。
|
|
77
|
+
|
|
78
|
+
数字与单位在空间足够时保持同一阅读单元。长数或窄屏容不下时,为整个单元重排或提供适当断行,不能用全局 `nowrap` 强行撑宽页面。分别检查 0、负值、空值、加载和错误,空值不显示成零,loading 图标不挤走标签。
|
|
79
|
+
|
|
80
|
+
用最长真实金额在窄屏和放大下观察:小数末位单独掉到下一行时,即使没有页面溢出也容易看错。先按实际内容分配列宽,避免任意最小表宽让金额列整列消失。确需二维比较时可将完整金额留在同一行,限制为表格内部滚动,给出可见提示与键盘入口;从起点滚到末端核对最后一列和小数位确实可读。若可用单列重排清楚保留项目与金额的对应关系,则无需横滚。
|
|
81
|
+
|
|
82
|
+
[数字与动态内容案例](../assets/visual-refinement/index.html#c3)使用 `¥12,345.67`、`12.5 MB`、长文件名与变化计数说明这些关系;格式仅为教学数据。目标项目的日期、精度、单位与货币仍由业务约定决定。
|
|
83
|
+
|
|
50
84
|
## 重排和共享组件
|
|
51
85
|
|
|
52
86
|
用项目 Grid/Flex 约束列和槽位,必要时给弹性列 minmax(0, 1fr)、给子项 min-width: 0。中文、长英文、URL、数字、空值、多行标签分别试排,图片与操作区预留尺寸。检查零条、一条和大量数据,切换加载和显露操作时比较控件位置。
|
|
@@ -13,9 +13,19 @@
|
|
|
13
13
|
| 图标 | Reicon 通过统一 Icon 适配。图形显示 18px,居中于 24×24px 透明框。目标视觉线宽 1.5 CSS px,外层按钮独立设置可操作热区。 |
|
|
14
14
|
| 动效 | 只在有助于理解反馈、来源或去向时使用,按[状态变化](motion.md)选择即时、短过渡或直接跟手。 |
|
|
15
15
|
|
|
16
|
+
按这套预设选值后,仍需看实际内容的层级和任务密度。页面存在模板感或细节偏差时,用[细节精修](visual-refinement.md)定位原因;不要靠统一扩大字号、间距或圆角代替判断。
|
|
17
|
+
|
|
18
|
+
## 按相邻轮廓检查嵌套圆角
|
|
19
|
+
|
|
20
|
+
只有相邻边缘需要形成同心弧时,才用外圆角减内缩距离估算内圆角。先标出外轮廓、对应内轮廓和它们之间的距离,计入所选边缘之间的 border 与 padding。读取某一个 `padding` 值不一定得到完整内缩距离。
|
|
21
|
+
|
|
22
|
+
例如外轮廓半径 24px、对应内轮廓向内缩进 8px,可从内半径 16px 开始核对。这是几何关系,最终仍应看裁切、图片边缘、焦点环和角落留白。[嵌套圆角案例](../assets/visual-refinement/index.html#c7)标明测量端点,并展示独立控件的例外。
|
|
23
|
+
|
|
24
|
+
距离较远的按钮、药丸形控件或不同曲率形状按自身角色处理。内缩距离大于外半径时不会产生负半径,改按实际形状选值;不能将减法强制套到每一层 DOM。
|
|
25
|
+
|
|
16
26
|
## 用实际几何与背景核对
|
|
17
27
|
|
|
18
28
|
- 普通文字至少 4.5:1。按 WCAG 大字阈值,常规 18pt(24 CSS px)或粗体 14pt(约 18.67 CSS px)起可用 3:1。**18px 的 600/700 标题按 4.5:1 检查**。按实际前景与背景计算,另看真实细字的可读性。必要图标、控件边界及状态提示对相邻色检查 3:1。
|
|
19
29
|
- 18px 图标居中在 24px 框产生 3px 几何留边。1px 边框、2px 焦点环和 1.5px 描边同属图形几何。通过框内居中实现,保留业务间距尺度。
|
|
20
30
|
- Reicon 的 24 单位 viewBox 缩到 18px 时,1.5 单位描边呈现为 1.125px。真实 stroke 路径可用 2 单位描边或按实际缩放核对 non-scaling-stroke。填充轮廓要选择匹配变体并观察笔画和镂空。避免给 fill 路径硬加 stroke。记录代表图标、显示尺寸、视觉重量及可实现边界。
|
|
21
|
-
- 普通 Web 目标按 WCAG 2.2 AA 的 24×24 CSS px
|
|
31
|
+
- 普通 Web 目标按 WCAG 2.2 AA 2.5.8 的 24×24 CSS px 或适用例外核对,包括间隔足够的较小目标。44×44 CSS px 属于 2.5.5 Enhanced 的 AAA 目标及其适用条件,不与 AA 混用。触摸场景可按项目平台选 44/48px 热区,再查相邻目标是否重叠。预设的字体、比例与 90/10 视觉预算均为本项目选型。
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
- [从现有产品取证](#从现有产品取证)
|
|
6
6
|
- [信息结构与交互](#信息结构与交互)
|
|
7
7
|
- [组件和视觉系统](#组件和视觉系统)
|
|
8
|
+
- [文字层级](#文字层级)
|
|
9
|
+
- [操作主次](#操作主次)
|
|
10
|
+
- [表面与边界](#表面与边界)
|
|
8
11
|
- [状态与可达性](#状态与可达性)
|
|
9
12
|
- [渐进实现与验收](#渐进实现与验收)
|
|
10
13
|
|
|
@@ -40,6 +43,8 @@
|
|
|
40
43
|
|
|
41
44
|
详情面板需要保留触发点,关闭后把焦点送回合理位置。危险操作要表达实际对象和后果;操作失败保留输入与上下文。不要仅因为“卡片好看”而把密集列表拆成低密度卡片。
|
|
42
45
|
|
|
46
|
+
少量选项要同时比较名称、容量和说明时,可用选择卡承载这些属性。大量短名称或高频重复操作通常适合保留紧凑列表。[选项与容器案例](../assets/visual-refinement/index.html#c1)同时展示两种条件。沿用单选、多选、链接或命令本来的语义和键盘行为,选择卡的外观不意味着可用普通 `div` 代替控件。用户要求保持布局时,先修当前容器内的层级与选中态,把结构变化作为单独建议。
|
|
47
|
+
|
|
43
48
|
## 组件和视觉系统
|
|
44
49
|
|
|
45
50
|
优先复用项目已安装且版本匹配的组件库。先读 `package.json`、锁文件、组件封装与当前框架。新依赖只有在现有能力无法满足需求时引入,并说明它替代了什么维护成本。不要直接复制一个陌生组件连带整套状态管理或 CSS 基座。
|
|
@@ -56,6 +61,38 @@
|
|
|
56
61
|
|
|
57
62
|
本地默认的字体选择、纯色背景和具体动效是一套明确的风格方向,不是操作系统或所有产品的通用规定。已有项目按其设计系统工作;用户明确选择这套默认风格时完整采用,并在设计记录里说明。
|
|
58
63
|
|
|
64
|
+
## 文字层级
|
|
65
|
+
|
|
66
|
+
指出用户首先需要读到的对象或结果,再核对标题、区域标题、字段标签、正文、辅助说明、元数据与数值是否各用适当角色。用已有字重、位置和分组拉开关系。多个层级都加粗时,先减少无理由的强调,不必让主标题继续变大。
|
|
67
|
+
|
|
68
|
+
辅助说明仍需让人读懂。有效文字按实际背景计算对比度,不通过极小字号、过淡灰色或全大写制造层级。保留必要字段说明、错误原因和恢复入口;空洞副标题可以删除,解释业务约束的文字不能一起隐藏。
|
|
69
|
+
|
|
70
|
+
核对字体文件与实际渲染字重,沿用[设计系统取证](design-system.md)。同字号的中文回退字形可能更密、更高,需看首行、标点和相邻图标。换行与数值的具体处理见[布局审查](layout-review.md#检查中文与混排换行)。[文字层级案例](../assets/visual-refinement/index.html#c2)保留文案与字号角色,用字重、留白和颜色角色说明主次变化。
|
|
71
|
+
|
|
72
|
+
## 操作主次
|
|
73
|
+
|
|
74
|
+
先为同一任务组写出每个动作的实际结果,再决定主操作、次操作、可撤回和危险操作的呈现。独立任务区可以各有主操作,不要求整个屏幕只有一个实心按钮。
|
|
75
|
+
|
|
76
|
+
同组多个按钮都很醒目时,核实它们是否确有相同优先级。取消可以沿用已有次按钮,保存保留主按钮;两个同等重要的独立选择则可以同权重呈现。调整按钮变体、位置或文案后,保留所有行为及可发现入口。
|
|
77
|
+
|
|
78
|
+
名称使用真实动作,例如“保存”“重试”“取消”。次按钮仍可读、可聚焦、可操作;重要行为不只藏在 hover。危险操作沿用实际可恢复性决定的确认或撤回方式,不能仅靠染红代替后果说明。具体显露与恢复方法见[交互审查](interaction-review.md)。
|
|
79
|
+
|
|
80
|
+
在[主次操作案例](../assets/visual-refinement/index.html#c6)用相同两个动作检查变体变化,再用键盘和相关 loading、错误状态复验。状态出现后,当前可执行的下一步仍应清楚。
|
|
81
|
+
|
|
82
|
+
## 表面与边界
|
|
83
|
+
|
|
84
|
+
先说明每层需要表达什么,再选择视觉线索。沿用实际 surface、border、overlay 等语义角色,不为一次精修改写整套主题。
|
|
85
|
+
|
|
86
|
+
| 对象 | 核对与选择 | 保留的边界 |
|
|
87
|
+
| --- | --- | --- |
|
|
88
|
+
| 内容分组 | 看留白和标题是否已经表达归属,再决定是否需要表面差异或分隔线 | 不删除有比较、分组或导航作用的容器。 |
|
|
89
|
+
| 输入控件或可选对象 | 保留用户识别控件、选中态及焦点所需的边界 | 必要视觉信息按实际相邻颜色检查;精致不等于边界越淡越好。 |
|
|
90
|
+
| 悬浮层 | 用现有表面、边界或统一阴影表达与后方内容的关系 | 打开后的内容、遮罩、焦点与触发器仍清楚。 |
|
|
91
|
+
| 同时有强边框、重阴影和高对比底色的层 | 判断这些线索是否重复表达同一层级,逐项简化无用途部分 | 不统一将 border 换成 shadow,暗色主题与强制颜色模式另看实际结果。 |
|
|
92
|
+
| 白底图片与白底容器 | 图像边缘确需辨认时,可试用不改变布局尺寸的内收边界 | 透明 logo、全出血图片及内容本身需要无边界的媒体保留原样。 |
|
|
93
|
+
|
|
94
|
+
紧邻嵌套边缘按[圆角方法](minimal-style.md#按相邻轮廓检查嵌套圆角)处理。图片裁切、焦点环与圆角必须一起看,不能只核对公式。[表面与媒体案例](../assets/visual-refinement/index.html#c8)同时展示可简化的重复边界和应保留的输入边界。
|
|
95
|
+
|
|
59
96
|
## 状态与可达性
|
|
60
97
|
|
|
61
98
|
对当前使用路径逐项检查适用状态,不为不存在的场景制造页面:
|
|
@@ -73,6 +110,12 @@
|
|
|
73
110
|
|
|
74
111
|
采用语义 HTML 或宿主等价控件;图标按钮有可读名称。文字和背景的对比按项目要求与[对比度阈值](minimal-style.md#用实际几何与背景核对)检查;不要只凭肉眼断言通过。状态不能只用颜色表达。动效尊重 reduced motion,手势有可用替代;布局变化不要制造跳动和焦点丢失。
|
|
75
112
|
|
|
113
|
+
有可见文字的控件优先用这段文字作为可访问名称;需要补充对象时,保持完整可见短语及其顺序,再追加对象,例如“收起预览:登记申请表.pdf”。不要用 `aria-label` 将“收起预览”替换为“收起登记申请表.pdf”,使语音操作无法按看到的文案匹配。展开、收起、重试等状态切换后逐项核对可见文字和实际可访问名称,而不只检查初始标签。依据为 WCAG 2.2 的 2.5.3 Label in Name;具体复验仍使用目标浏览器及所需辅助技术。
|
|
114
|
+
|
|
115
|
+
颜色要成组核对:文字与所在背景、图标与表面、选中与未选中、错误与正常、焦点与相邻色。必要控件边界和状态信息适用的对比要求,与纯装饰线不同。支持强制颜色模式时检查真实呈现,避免用低透明度让控件和焦点一起消失。
|
|
116
|
+
|
|
117
|
+
精修后沿用同一文字角色、容器和操作优先级检查受影响状态。加载图标、骨架、辅助提示与计数出现时,观察原操作是否被推走或遮挡。静态画面通过后仍要操作,不能仅把初始状态磨好。
|
|
118
|
+
|
|
76
119
|
## 渐进实现与验收
|
|
77
120
|
|
|
78
121
|
按影响给问题排序。无法提交、键盘走不通或有数据丢失风险的路径先处理,再处理需绕行的交互和跨页面漂移,最后处理不阻断任务的光学校准。记录入口、前后状态、复现动作、证据、影响与改动位置。审计止于发现和建议。修复请求则沿同一问题清单修改并验证。
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# 把审美请求落实为细节修改
|
|
2
|
+
|
|
3
|
+
用于“有 AI 味”“细节粗糙”“保持结构磨细”或参考图学习。交付可定位的视觉问题、适用规则、最小改法和同条件证据。具体布局、交互、状态与主题值沿用本包已有方法。
|
|
4
|
+
|
|
5
|
+
## 选择本次终点
|
|
6
|
+
|
|
7
|
+
| 请求 | 执行与交付 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| 只审计 | 看实际画面,说明症状、影响、依据与修改位置,交付建议。 |
|
|
10
|
+
| 保持结构精修 | 保留已限定的布局、功能、信息与品牌,修改造成问题的样式或组件,再复验受影响状态。 |
|
|
11
|
+
| 学习或复刻参考图 | 分开记录可辨认的关系和不确定信息,对照项目选择可迁移的部分。精确复刻只覆盖可验证的来源和范围。 |
|
|
12
|
+
| 新页面或重设计 | 按[产品任务](product-ui.md)制定设计;需要完整体验确认时,由当前负责人沿用 `dev-prototype`,携带有效设计依据。 |
|
|
13
|
+
|
|
14
|
+
沿用当前任务和已确认选择。已有品牌与组件优先,无基线时才采用[极简预设](minimal-style.md)。保持结构的请求不包含重排导航、改业务流程或替换组件库。发现结构性问题时记录其影响,继续完成范围内可独立处理的细节。
|
|
15
|
+
|
|
16
|
+
## 先辨认参考图能证明什么
|
|
17
|
+
|
|
18
|
+
记录来源、原始尺寸、画面位置和能辨认的状态。只裁切或放大有助于观察的区域,同时保留整屏上下文。放大不能恢复原来不存在的文字和像素信息。
|
|
19
|
+
|
|
20
|
+
| 类型 | 记录方式 | 怎样使用 |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| 可观察 | “同一表单里的两个按钮都使用醒目实心填充” | 找出目标项目中具有相同任务关系的区域。 |
|
|
23
|
+
| 推断 | “右侧可能通过弱化次按钮来突出提交动作” | 与真实动作、代码和状态核对,证据不足时保留假设。 |
|
|
24
|
+
| 无法辨认 | 看不清的正文、字体名、色号、精确距离或阴影参数 | 保留未知,按项目已有角色值制作可检查的候选。 |
|
|
25
|
+
|
|
26
|
+
提取关系时分别看阅读先后、元素归属、比较方式、操作权重、边缘与留白。参考图中的某张选择卡只能说明该情境的呈现,不能证明所有列表都应改成卡片。宣传插图、表情标记和广告不自动成为目标产品的样式要求。
|
|
27
|
+
|
|
28
|
+
如果用户要精确还原无法辨认的内容,说明该部分需要清晰来源。可辨认的关系和不依赖它的工作继续完成。把新决定标为本次方案,不回填成参考图原文。
|
|
29
|
+
|
|
30
|
+
## 从症状选择完整方法
|
|
31
|
+
|
|
32
|
+
先说这一区域首先要读到什么、接下来要做什么。用相同内容看当前画面,再按症状读取对应方法与案例。无需把整套案例逐一打开。
|
|
33
|
+
|
|
34
|
+
| 可见症状 | 先核对什么 | 完整方法与局部案例 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| 列表难比较,或每个对象都套同样卡片 | 比较属性、重复操作和信息密度,是否真的需要独立容器 | [容器选择](product-ui.md#信息结构与交互)、[C1 选项与容器](../assets/visual-refinement/index.html#c1) |
|
|
37
|
+
| 标题、标签、说明一样醒目,或次文字难读 | 文字角色、实际字体和字重、背景上的对比度 | [文字层级](product-ui.md#文字层级)、[C2 排版](../assets/visual-refinement/index.html#c2) |
|
|
38
|
+
| 中文末行零碎,混排单位断开,长文件名溢出 | 宽度、语言、行高、换行策略和实际数据 | [文字换行](layout-review.md#检查中文与混排换行)、[C2 排版](../assets/visual-refinement/index.html#c2) |
|
|
39
|
+
| 金额难比较,计数变化推走标签 | 数字字形、格式、单位与稳定槽位 | [数字与单位](layout-review.md#保持数字与单位稳定)、[C3 动态内容](../assets/visual-refinement/index.html#c3) |
|
|
40
|
+
| 标题像属于前一组,页面过散或过挤 | 语义分组、实际可见距离和当前任务密度 | [分组留白](layout-review.md#先识别分组再选择间隙)、[C4 留白](../assets/visual-refinement/index.html#c4) |
|
|
41
|
+
| 图标悬在两行文字中间,文本列不齐 | 首行、图标框、字体度量、共享槽位与热区 | [光学对齐](layout-review.md#先布局结构再视觉校准)、[C5 图标](../assets/visual-refinement/index.html#c5) |
|
|
42
|
+
| 同组多个醒目按钮竞争,次操作又找不到 | 每个动作的用途和真实优先级、可发现入口 | [操作主次](product-ui.md#操作主次)、[C6 操作与状态](../assets/visual-refinement/index.html#c6) |
|
|
43
|
+
| 紧邻内外边缘的弧线互相挤压 | 两条对应轮廓、内缩距离与圆角角色 | [嵌套圆角](minimal-style.md#按相邻轮廓检查嵌套圆角)、[C7 圆角](../assets/visual-refinement/index.html#c7) |
|
|
44
|
+
| 边框、阴影和色块一起抢注意,图片边缘不清 | 分组、控件识别、浮层深度与媒体类型各需什么线索 | [表面与边界](product-ui.md#表面与边界)、[C8 表面与媒体](../assets/visual-refinement/index.html#c8) |
|
|
45
|
+
| 只有初始画面整齐,选中或加载后走样 | 成组的语义颜色、状态尺寸、焦点和异步内容 | [状态与可达性](product-ui.md#状态与可达性)、[状态变化](motion.md)、[C3](../assets/visual-refinement/index.html#c3)、[C6](../assets/visual-refinement/index.html#c6) |
|
|
46
|
+
|
|
47
|
+
案例使用相同内容说明局部变化,并保留适用条件与反例。示例数值不替代目标项目的设计系统。案例不是用户确认原型;实际效果仍须在目标页面检查。离线样例的字体可能回退,应按实际渲染说明,不能把声明的字体名当作加载证据。
|
|
48
|
+
|
|
49
|
+
## 找到造成偏差的位置再修改
|
|
50
|
+
|
|
51
|
+
把观察到的症状与代码联系起来。以下判断可组合使用,尚未复现的解释保持为假设。
|
|
52
|
+
|
|
53
|
+
| 核对结果 | 修改位置 | 完成条件 |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| 项目已有适用规则,当前页面没有使用 | 对应组件、变体或局部调用 | 页面使用原有角色,同状态下偏差消失,其他调用方保持原有关系。 |
|
|
56
|
+
| 多个调用方都偏离同一规则 | 共享组件或实际 CSS/theme 值源 | 代表性调用方一起复验;改变的语义与作用域有依据。 |
|
|
57
|
+
| 同一角色在不同位置互相冲突 | 先核实它们是否确属同一用途 | 用同一规则统一;真实用途不同则保留有名称的变体,记录理由。 |
|
|
58
|
+
| 既有规则没有表达当前需要 | 本次所需的角色或组件规则 | 新规则有任务、边界、调用方与可观察结果,不生成无用途的色板或组件。 |
|
|
59
|
+
| 容器或信息结构与任务不匹配 | 记录结构问题及影响 | 只在已授权重设计范围处理;局部精修仍可独立完成。 |
|
|
60
|
+
|
|
61
|
+
例如,提交和取消都使用 `primary` 变体,项目已有可达的次按钮时,先改取消的变体。若取消在所有弹窗都错误读取主按钮角色,再检查共享封装。仅一个表单的问题不足以更换全局品牌色。
|
|
62
|
+
|
|
63
|
+
按问题族修改,保留可以解释的前后变化。无需固定只改一个属性,也不设必须做满的轮数。图标光学偏移要先排除父布局和槽位问题;字体、间距和颜色都从实际值源调整,避免新增一套与运行样式脱节的记录。
|
|
64
|
+
|
|
65
|
+
## 检查模板化的具体表现
|
|
66
|
+
|
|
67
|
+
在正常尺寸下先看整体,再检查涉及问题的局部。说明第一眼看到的对象是否与该区域的阅读或操作任务相符。这个观察用于提出和检验假设,不是眼动实验,也不产生客观“审美分数”。
|
|
68
|
+
|
|
69
|
+
| 当前表现 | 核对与处理 |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| 每个区域都有相同卡片、圆角、阴影 | 相同职责保留一致性;只作包裹而没有分组作用的层简化。 |
|
|
72
|
+
| 每个标题都有编号、小标签或徽章 | 有类别、顺序、权限或状态含义就保留,否则移除无语义装饰。 |
|
|
73
|
+
| 强调色与实心按钮到处出现 | 按实际任务组校准主次,检查降低权重后的文字和入口仍可读、可达。 |
|
|
74
|
+
| 以另一种流行字体、配色或版式替换全部页面 | 说明它与内容、品牌和用户要求的关系;局部请求继续沿用现有系统。 |
|
|
75
|
+
| 每张卡都悬停缩放、每段内容都入场 | 按[动效方法](motion.md)检查是否解释状态,无用途的运动不增加。 |
|
|
76
|
+
| 大标语、伪统计、占位头像掩盖内容不足 | 核实文案和数据,使用与任务有关的真实内容;必要说明与恢复信息保留。 |
|
|
77
|
+
| 画面干净了,但比较和操作更费力 | 恢复必要信息、名称与密度,再调整层级。 |
|
|
78
|
+
|
|
79
|
+
不以某种字体、色相、卡片或风格的出现次数判定质量。克制也会成为固定模板,保留有明确任务依据的差异。
|
|
80
|
+
|
|
81
|
+
## 用同一场景复验并交付
|
|
82
|
+
|
|
83
|
+
沿用[实际界面验收](product-ui.md#渐进实现与验收),在原入口回到相同数据、状态、主题、语言、窗口与实际字体。修改前先定义要检查的关系,例如标题归属、次按钮权重或计数位宽,避免事后只挑漂亮画面。
|
|
84
|
+
|
|
85
|
+
1. 对照整屏与局部画面,指出每个改动解决的症状和对应样式位置。计算样式帮助定位原因,不能替代查看实际画面。
|
|
86
|
+
2. 使用相同内容复验长短文字、窄屏和相关状态。对 loading、选中、失败或禁用等受影响状态,继续核对文字角色、成组颜色、尺寸、焦点和恢复入口。仅测试当前任务实际涉及的分支。
|
|
87
|
+
3. 实际操作保留的动作。视觉收紧后检查热区、键盘焦点、可发现性和布局稳定;动效仍按真实播放方法检查。
|
|
88
|
+
4. 在同一问题清单标明改善、无明显变化、退化或未验证,说明剩余问题及影响。没有浏览器时交付静态审查与可复验入口,不能宣称运行效果已通过。
|
|
89
|
+
|
|
90
|
+
用[设计记录](../assets/design.md)或[审计模板](../assets/ui-audit.md)承接结果。记录位置与状态、症状、任务影响、项目依据、最小改法、实际定位、前后证据和例外;局部问题可用短段落。有效原型范围和已经完成的决定继续复用。
|
|
91
|
+
|
|
92
|
+
问题已处理且受影响场景已验证后结束。还有退化时修复对应原因,再复验该范围。有限样例只说明所验范围,不用虚构百分比、任意满分或要求无限迭代来宣称“去 AI 味”。
|