fix(design-system): h2·h3·h4에 제목 단계 크기와 굵기를 준다 (08-04)
문제: theme.css가 넣는 Tailwind preflight가 제목의 크기·굵기를 본문으로 되돌린다. base.css는 h1 크기와 h2 줄 간격만 정해, 6개 라우트 모두 h2·h3이 16px/400으로 본문과 같았다. 구획을 훑어볼 수 없고, 제품마다 제목 크기를 따로 만들게 된다. 고른 방법: 리뷰의 최소 개선 방향대로 primitive에 --font-size-xl(1.25rem) ·--font-size-2xl(1.5rem)을 더하고, semantic에 제목 단계 토큰 (--font-size-heading-2/3/4, --font-weight-heading = semibold)을 둔 뒤 base.css에서 h2·h3·h4에 적용했다. 컴포넌트 제목(카드 h3, 상태 화면 h2)은 자기 수준의 기본 스타일을 그대로 받는다. 제품은 semantic 토큰 값만 바꿔 단계를 조정한다. 값(24/20/16px, 650)은 1.2배 안팎의 단계로 골랐다. 버린 대안: 컴포넌트마다 크기를 주기 — 같은 값이 여러 곳에 흩어진다. token-contract 필수 목록에 추가 — 다운스트림 토큰 파일이 바로 실패하고, 결과는 아래 e2e가 지킨다. 위험·한계: 화면이 바뀐다. 시각 골든(app-shell, state-surfaces 등)은 오케스트레이터가 갱신한다. 상태 화면이 카드(h3) 안에서 h2로 더 크게 보이는 문제는 08-05가 다룬다. 값 자체는 디자인 결정이라 바꿀 수 있다. 검증: - RED: 새 tests/e2e/typography.spec.ts가 수정 전 chromium에서 실패 (h2 16px, h3 16px: "Expected: > 16, Received: 16"). - GREEN: 같은 spec chromium·firefox·webkit 3/3 통과. accessibility·i18n· ui-gallery·app-shell·responsive·theme·design-system-interactions· compact-smoke + typography chromium/chromium-compact 32/32 통과(별도 playwright 설정, vite preview, pnpm 없이 빌드). - check-design-system PASS(48 tokens). 시각 회귀는 미실행. Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-04
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
--font-size-sm: 0.875rem;
|
||||
--font-size-md: 1rem;
|
||||
--font-size-lg: 1.125rem;
|
||||
--font-size-xl: 1.25rem;
|
||||
--font-size-2xl: 1.5rem;
|
||||
--line-height-tight: 1.25;
|
||||
--line-height-normal: 1.5;
|
||||
--line-height-relaxed: 1.7;
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
--color-danger-border: oklch(0.72 0.12 25);
|
||||
|
||||
--font-sans: system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
|
||||
/* 08-04. One step per heading level; a product retunes the scale here. */
|
||||
--font-size-heading-2: var(--font-size-2xl);
|
||||
--font-size-heading-3: var(--font-size-xl);
|
||||
--font-size-heading-4: var(--font-size-md);
|
||||
--font-weight-heading: var(--font-weight-semibold);
|
||||
--spacing-page: var(--space-6);
|
||||
--radius-control: var(--radius-sm);
|
||||
--radius-surface: var(--radius-md);
|
||||
|
||||
@@ -34,8 +34,25 @@
|
||||
letter-spacing: -0.04em;
|
||||
}
|
||||
|
||||
/* 08-04. Tailwind's preflight resets headings to body text; each level
|
||||
gets its own step so a section title does not read like a paragraph. */
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-weight: var(--font-weight-heading);
|
||||
line-height: var(--line-height-tight);
|
||||
}
|
||||
|
||||
h2 {
|
||||
line-height: 1.25;
|
||||
font-size: var(--font-size-heading-2);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--font-size-heading-3);
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: var(--font-size-heading-4);
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
|
||||
Reference in New Issue
Block a user