diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index 3ecadd6..e5bb1d9 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -2473,7 +2473,14 @@ dialog::backdrop { .public-document-body > section + section { margin-top: 76px; padding-top: 70px; border-top: 1px solid var(--line); } .public-document-body h2, .reference-purpose h2, -.document-relations h2 { margin: 0 0 20px; font-size: 29px; font-weight: 650; letter-spacing: -0.038em; } +/* + 구역 제목은 한 급이다. 정본은 `.section-heading-row h2` 이고(최근 기록·종류별로 읽기가 쓴다), + 그 안에 들어가지 않는 두 구역이 크기만 각자 적어 두어 굵기를 아무도 정하지 않았다. 그래서 + 400 으로 떨어져, 같은 화면에서 「구조별로 알게 된 것」만 형제 구역보다 작고 가늘게 나왔다 — + 디자인이 빠진 것처럼 보인 자리다. 값을 정본과 맞춘다. +*/ +.document-relations h2, +.topic-variants h2 { margin: 0 0 20px; font-size: 30px; font-weight: 650; letter-spacing: -0.045em; } .public-document-body h3 { margin: 0; font-size: 18px; font-weight: 630; } .public-document-body p, .public-document-body li, @@ -2863,8 +2870,6 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 .topic-variants h2 { margin: 10px 0 20px; - font-size: 26px; - letter-spacing: -0.03em; } .topic-variants ul { @@ -2961,8 +2966,6 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 .home-comparison h2 { margin: 10px 0 0; - font-size: 30px; - letter-spacing: -0.035em; } .home-comparison ul { diff --git a/tests/features/tech-log/section-heading-rank.test.ts b/tests/features/tech-log/section-heading-rank.test.ts new file mode 100644 index 0000000..324ef0f --- /dev/null +++ b/tests/features/tech-log/section-heading-rank.test.ts @@ -0,0 +1,54 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { test } from "vitest"; + +/** + * 한 화면에 나란히 서는 구역 제목은 같은 급이어야 한다. + * + *

정본은 `.section-heading-row h2` 다. 그 안에 들어가지 않는 두 구역이 크기만 각자 적어 두어 + * 굵기를 아무도 정하지 않았고, 400 으로 떨어져 「구조별로 알게 된 것」만 형제 구역보다 작고 + * 가늘게 나왔다 — 규칙이 없는 게 아니라 절반만 있었고, 그래서 「디자인이 안 됐다」로 보였다. + */ +const RAW = readFileSync("src/features/tech-log/presentation/styles/globals.css", "utf8"); + +/** + * 좁은 화면용 값은 뺀다. 화면 폭마다 급이 달라지는 것은 의도이고, 여기서 보려는 것은 같은 + * 폭에서 나란히 설 때의 급이다. + */ +const CSS = RAW.replace(/@media[^{]*\{(?:[^{}]*\{[^}]*\})*[^{}]*\}/gu, ""); + +/** 나란히 서는 구역 제목들. 정본이 맨 앞이다. */ +const SECTION_HEADINGS = [ + ".section-heading-row h2", + ".document-relations h2", + ".topic-variants h2", +] as const; + +/** 마지막으로 선언된 값을 읽는다 — 뒤에 오는 규칙이 이긴다. */ +function declared(selector: string, property: string): string | null { + const escaped = selector.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"); + const blocks = [ + ...CSS.matchAll(new RegExp(`(?:^|,|\\n)\\s*${escaped}\\s*(?:,[^{]*)?\\{([^}]*)\\}`, "gu")), + ]; + let value: string | null = null; + for (const block of blocks) { + const found = new RegExp(`${property}:\\s*([^;]+)`, "u").exec(block[1]!); + if (found) value = found[1]!.trim(); + } + return value; +} + +test("나란히 서는 구역 제목이 같은 크기와 굵기를 쓴다", () => { + const canonical = SECTION_HEADINGS[0]; + for (const property of ["font-size", "font-weight"]) { + const want = declared(canonical, property); + assert.ok(want, `${canonical} 에 ${property} 가 없다 — 정본이 값을 갖고 있어야 한다`); + for (const selector of SECTION_HEADINGS.slice(1)) { + assert.equal( + declared(selector, property), + want, + `${selector} 의 ${property} 가 ${canonical} 과 다르다`, + ); + } + } +}); diff --git a/topic-full.png b/topic-full.png new file mode 100644 index 0000000..3614ce2 Binary files /dev/null and b/topic-full.png differ diff --git a/topic-variants-now.png b/topic-variants-now.png new file mode 100644 index 0000000..e6108a0 Binary files /dev/null and b/topic-variants-now.png differ