From 165ed1996823f3b4fb0afb7401f6d141d5e361e7 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sun, 1 Nov 2026 18:34:28 +0900 Subject: [PATCH] =?UTF-8?q?fix(design-system):=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=ED=86=A0=ED=81=B0=EC=9D=84=20=EB=B3=B5?= =?UTF-8?q?=EC=82=AC=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B3=A0=20=EC=9D=BD?= =?UTF-8?q?=EA=B2=8C=20=ED=95=9C=EB=8B=A4=20(UI-03)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 계약에 있는 컴포넌트 토큰 4개를 읽는 스타일이 없었다. 기본 버튼은 bg-action을 직접 썼고, 현재 메뉴는 --navigation-active-background의 계산식을 다시 적었다. 그래서 서비스가 이 토큰으로 브랜드를 바꿔도 화면이 바뀌지 않았다. 기본 버튼과 현재 메뉴가 토큰을 읽게 했다. 변형 버튼은 뒤에 오는 같은 우선순위 규칙이라 그대로 덮어쓴다. check:design-system이 계약의 컴포넌트 토큰을 읽는 스타일이 하나도 없으면 실패한다. 위험: 기본 버튼 배경 지정 방식이 utility에서 토큰으로 바뀐다. 보이는 색은 같다. 검증: 바꾸기 전 검사가 토큰 4개를 보고했고, 바꾼 뒤 통과했다. --- scripts/check-design-system.ts | 10 ++++++++++ src/presentation/styles/theme/primitives.css | 7 ++++--- src/presentation/styles/theme/shell.css | 6 +----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/check-design-system.ts b/scripts/check-design-system.ts index 49121683..ac0a5a5d 100644 --- a/scripts/check-design-system.ts +++ b/scripts/check-design-system.ts @@ -125,6 +125,16 @@ for (const [theme, properties] of [ } } +// UI-03. A component token nobody reads is a second copy of a decision: +// the style that should use it repeats the formula instead, and a product +// that rebrands through the token sees nothing change. +const styleSources = cssSources.filter(({ file }) => file !== tokenFiles.component); +for (const token of REQUIRED_COMPONENT_TOKENS) { + if (!styleSources.some(({ source }) => source.includes(`var(${token}`))) { + failures.push(`component token ${token} is defined but no style reads it`); + } +} + const componentSource = await readFile(tokenFiles.component, "utf8"); if (!componentSource.includes("@media (forced-colors: active)")) { failures.push("forced-colors token fallback is missing"); diff --git a/src/presentation/styles/theme/primitives.css b/src/presentation/styles/theme/primitives.css index cfe29c31..9b6eff2d 100644 --- a/src/presentation/styles/theme/primitives.css +++ b/src/presentation/styles/theme/primitives.css @@ -12,19 +12,20 @@ } .ui-button { - @apply rounded-control bg-action px-4 py-2 font-semibold; + @apply rounded-control px-4 py-2 font-semibold; display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; border: 0; - color: var(--color-on-action); + background: var(--button-primary-background); + color: var(--button-primary-content); text-decoration: none; cursor: pointer; } .ui-button:hover { - @apply bg-action-hover; + background: var(--button-primary-hover); } .ui-button:disabled { diff --git a/src/presentation/styles/theme/shell.css b/src/presentation/styles/theme/shell.css index 71bf0779..3d3530bd 100644 --- a/src/presentation/styles/theme/shell.css +++ b/src/presentation/styles/theme/shell.css @@ -180,11 +180,7 @@ .app-navigation__link.is-active { color: var(--color-action-hover); - background: color-mix( - in oklab, - var(--color-action) 14%, - var(--color-panel) - ); + background: var(--navigation-active-background); font-weight: 800; }