fix(design-system): 컴포넌트 토큰을 복사하지 않고 읽게 한다 (UI-03)
계약에 있는 컴포넌트 토큰 4개를 읽는 스타일이 없었다. 기본 버튼은 bg-action을 직접 썼고, 현재 메뉴는 --navigation-active-background의 계산식을 다시 적었다. 그래서 서비스가 이 토큰으로 브랜드를 바꿔도 화면이 바뀌지 않았다. 기본 버튼과 현재 메뉴가 토큰을 읽게 했다. 변형 버튼은 뒤에 오는 같은 우선순위 규칙이라 그대로 덮어쓴다. check:design-system이 계약의 컴포넌트 토큰을 읽는 스타일이 하나도 없으면 실패한다. 위험: 기본 버튼 배경 지정 방식이 utility에서 토큰으로 바뀐다. 보이는 색은 같다. 검증: 바꾸기 전 검사가 토큰 4개를 보고했고, 바꾼 뒤 통과했다.
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user