Add theme system with SSR support and inverted sidebar tokens#1
Merged
Conversation
ThemeProvider, useTheme 훅, ThemeToggle 컴포넌트를 추가하여 라이트/다크 모드 전환 기능을 구현했습니다. localStorage 기반 영속화와 OS prefers-color-scheme 자동 감지를 지원하며, SSR 환경에서 FOUC를 방지하기 위한 `getThemeInitScript()`를 server-safe entry (`@wireweave/ui/server`)로 분리했습니다. theme.css에 Orange 팔레트를 추가하고 Sidebar 시맨틱 토큰을 인버전 패턴으로 재정의했습니다. vite config에서 server 청크에는 'use client' banner를 제외하도록 조건부 처리를 추가했습니다.
페이지 배경과 반대 톤을 유지하도록 사이드바 색상 시스템을 재구성했습니다. 모든 하드코딩된 팔레트 참조를 `--color-sidebar-*` 시맨틱 토큰으로 교체하고, 라이트/다크 모드에서 자동으로 인버전되도록 구현했습니다.
ThemeToggle 컴포넌트의 Storybook 스토리를 추가하고 Sidebar 스토리를 테마 시스템과 통합했습니다. 라이트/다크 모드 전환 시 사이드바 인버전 동작을 시각적으로 확인할 수 있으며, 2-way/3-way 토글 모드와 크기 variants를 모두 테스트할 수 있습니다.
서버 사이드 유틸리티를 위한 `/server` sub-export를 추가하고 버전을 0.3.0으로 올렸습니다.
Sidebar 토큰 시스템과 테마 API 사용법을 문서화했습니다. Sidebar 인버전 토큰 테이블, sub-export 상세 설명, ThemeProvider/useTheme/ThemeToggle 사용법, FOUC 방지를 위한 getThemeInitScript 가이드를 추가했습니다.
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.
Summary
ThemeProvider,useTheme,ThemeToggle컴포넌트로 라이트/다크/시스템 모드 지원getThemeInitScript()제공 (@wireweave/ui/serverentry)Changes
src/components/theme.tsx+theme-script.ts)ThemeProvider: localStorage 영속 + OSprefers-color-scheme자동 추적ThemeToggle: 2-way (light/dark) 또는 3-way (light/dark/system) 토글 버튼getThemeInitScript(): hydration 전 inline script로 FOUC 방지 (server-safe)src/styles/theme.css)--color-sidebar-*시맨틱 변수 11종 추가 (배경, hover, foreground, active, border, overlay, logo 등)slate-800→ 다크:slate-100)color-mix(in oklab, var(--color-blue-500) 20%, transparent)패턴 사용src/components/sidebar.tsx)--color-sidebar-*토큰으로 교체--color-sidebar-logo-from/to토큰으로 교체package.json,vite.config.ts)@wireweave/ui/serverentry 추가 (getThemeInitScriptSSR 호출용)'use client'배너 자동 삽입, server entry는 제외ThemeToggle.stories.tsx: 2-way/3-way 토글 예제, size variantsSidebar.stories.tsx:ThemeProviderdecorator로 라이트/다크 토큰 검증 화면 추가CLAUDE.md)/serverentry 설명)Test Plan
ThemeToggle2-way/3-way 모드 동작 검증getThemeInitScript()반환 문자열 형식 검증prefers-color-scheme변경 시 system 모드 자동 반응 확인