refactor(blog): @theme로 디자인 토큰 전환 + arbitrary value 제거 (#120)#122
Merged
Conversation
원인 규명: Tailwind v4 @theme는 정상 동작했음. #94의 "미동작" 판단은 빌드 산출물의 minify된 값(#00ff00→#0f0 등)을 minify 전 문자열로 grep한 오진이었다. 실험으로 @theme가 유틸(.bg-brand)과 변수(--color-brand) 모두 정상 생성함을 확인. - global.css: :root → @theme (브랜드/ink/surface/border 토큰) - 컴포넌트 17곳: bg-[var(--color-*)] → bg-brand/bg-ink/border-border 등 깔끔한 유틸로 전환 - 값 동일 → 시각 변화 0 (빌드 CSS·스크린샷·E2E로 확인) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Owner
Author
🔍 코드 리뷰 (self-review)기계적 전환(arbitrary→@theme 유틸)이라 시각 변화 0이고 검증이 끝나, 고칠 미흡점은 없습니다. 핵심만 기록합니다. 가장 중요한 결론
의도적 결정
검증
|
This was referenced Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
원인 규명 (핵심)
#94에서 "Tailwind v4
@theme가 Turbopack 빌드에서 토큰/유틸을 생성하지 않는다"고 판단해:root+ arbitrary value(bg-[var(--color-*)])로 우회했었습니다.이는 오진이었습니다. 실험으로 확인:
@theme { --color-x: #00ff00 }→.bg-x{background-color:var(--color-x)}+--color-x:#0f0모두 정상 생성.#00ff00→#0f0)을 minify 전 문자열로 grep해서 생긴 false negative였습니다. (#6366f1처럼 minify 안 되는 값으로 재확인 → 정상 출력)변경
global.css::root→@theme(브랜드 스케일·ink·surface·border 토큰 6종)bg-[var(--color-ink)]→bg-ink,bg-[var(--color-brand-strong)]→bg-brand-strongbg-[var(--color-surface-muted)]→bg-surface-muted,border-[var(--color-border)]→border-borderring-[var(--color-brand)]→ring-brand,bg-[var(--color-ink)]/50→bg-ink/50등검증
--color-*6종:root출력 +.bg-ink/.bg-brand-strong/.border-border유틸 생성 +bg-ink/50color-mix확인범위 결정 — 텍스트 그레이 "전면 토큰화"는 보류
#120에 적힌 "muted 텍스트 등 전면 토큰화"는 의도적으로 제외했습니다. 이유:
text-gray-{400,500,600,700,800,900}6개 음영마다 토큰이 필요 → 과도한 토큰화(역할 없는fg-700등).→ 이건 별도 디자인 결정으로 다루는 게 맞다고 판단. 이 PR은 @theme 부채 해소 + 클린 유틸 전환에 집중.
🤖 Generated with Claude Code