refactor: design-colors 规则与反例去夹心改 grid 分割卡——原排版「标题+小字一行 → ✗/✓ 左右一行」逐条堆叠读作夹心积木;改为每条规则一张 border-2 卡,卡内三栏 grid 一次分割(标题块=序号+规则名+mute 短注纵排 │ ✗ 反例 │ ✓ 正例,divide-x-2 ink/15 内隔线),节奏从「行/分割交替」收敛为「一卡一规则」;移动端(<md)卡内纵向堆叠(标题 → ✗ → ✓ 各占整行),DoDont 允许换行(题注 basis-160px 空间不足即折到演示块下方),390 宽截图自检无新增溢出(存量 1px 亚像素取整与本改无关,stash 前后同值);视觉基线随版式 --update-snapshots=all 整批重建,全量 e2e 93/93 绿
CI / check (pull_request) Failing after 19m19s

This commit was merged in pull request #11.
This commit is contained in:
cqh963852 committed 2026-10-28 11:32:07 +08:00
1 parent 63581a8658
commit 8771de1ba9
2 files changed
+18 -15

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 207 KiB

+18 -15
View File
@@ -88,14 +88,14 @@ function DoDont({
text: string
}) {
return (
<div className="flex flex-1 items-center gap-3">
<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 max-md:pb-1 md:flex-nowrap md:py-4 md:pl-4 md:pr-5">
<span
className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 border-ink text-[11px] font-extrabold ${bad ? 'bg-clash1a text-paper' : 'bg-clash1b'}`}
>
{bad ? '✗' : '✓'}
</span>
{children}
<p className="m-0 flex-1 text-small leading-snug text-body">{text}</p>
<p className="m-0 flex-1 basis-[160px] text-small leading-snug text-body">{text}</p>
</div>
)
}
@@ -136,22 +136,25 @@ export function App() {
</div>
</Section>
<Section label="规则与反例" note="三条硬规则,✗/✓ 对照即规范">
<div className="space-y-5">
<div className="grid gap-4">
{RULES.map((r, i) => (
<div key={r.name}>
<div className="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
<span className="flex h-[18px] w-[18px] shrink-0 translate-y-[2px] items-center justify-center rounded-full border-2 border-ink bg-ink text-[10px] font-extrabold text-paper">
{i + 1}
</span>
<b className="text-[13px]">{r.name}</b>
<div
key={r.name}
className="grid gap-y-3 rounded-xl border-2 border-ink bg-paper p-4 md:grid-cols-[minmax(0,280px)_minmax(0,1fr)_minmax(0,1fr)] md:gap-y-0 md:divide-x-2 md:divide-ink/15 md:p-0"
>
<div className="grid content-start gap-1.5 md:py-4 md:pr-4 md:pl-5">
<div className="flex items-center gap-2">
<span className="flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border-2 border-ink bg-ink text-[10px] font-extrabold text-paper">
{i + 1}
</span>
<b className="text-[13px]">{r.name}</b>
</div>
<i className="t-small-mute not-italic">{r.note}</i>
</div>
<div className="mt-2 grid grid-cols-2 gap-3">
<DoDont bad text={r.badCap}>
{r.badDemo}
</DoDont>
<DoDont text={r.goodCap}>{r.goodDemo}</DoDont>
</div>
<DoDont bad text={r.badCap}>
{r.badDemo}
</DoDont>
<DoDont text={r.goodCap}>{r.goodDemo}</DoDont>
</div>
))}
</div>