Skip to content

refactor(theme): replace brand-color ThemeProvider with light/dark mode toggle#282

Open
3o14 wants to merge 8 commits into
devfrom
chore/provider-wonju
Open

refactor(theme): replace brand-color ThemeProvider with light/dark mode toggle#282
3o14 wants to merge 8 commits into
devfrom
chore/provider-wonju

Conversation

@3o14
Copy link
Copy Markdown
Member

@3o14 3o14 commented May 21, 2026

Summary

기수별 브랜드 컬러 기반의 ThemeProvider를 data-theme 속성을 활용한 라이트/다크 모드 토글 방식으로 전환하고, 디자인 토큰 값의 SSOT를 tokens/tokens.json → Style Dictionary 파이프라인으로 일원화했습니다.

Changes

주요 변경

  • ThemeProvider의 테마 적용 방식을 assignInlineVars 기반에서 data-theme 속성 기반으로 변경했습니다.
  • VE contract(contract.css.ts)의 color/spacing/radius 구조를 semantic 토큰 계층으로 수정했습니다.
  • themes.css.ts에서 JS 상수를 시멘틱 토큰 참조로 교체했습니다.
    • 토큰 자동 매핑해주는mapVars 유틸 함수/테스트코드 작성했습니다.

기타

  • @sipe-team/theme에서 @vanilla-extract/dynamic 미사용 의존성 제거했습니다.
  • ThemeProvider의 역할이 다크/라이트 토글 역할로 바뀌어서 스토리북 제거했습니다.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 83f6540

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@sipe-team/theme Major
@sipe-team/tokens Minor
@sipe-team/side Patch
@sipe-team/accordion Patch
@sipe-team/avatar Patch
@sipe-team/badge Patch
@sipe-team/button Patch
@sipe-team/card Patch
@sipe-team/checkbox Patch
@sipe-team/chip Patch
@sipe-team/divider Patch
@sipe-team/input Patch
@sipe-team/radio Patch
@sipe-team/skeleton Patch
@sipe-team/switch Patch
@sipe-team/typography Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/v1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9d337d9d-b7b6-43b3-9cec-cd101c116acb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/provider-wonju

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
packages/theme/src/ThemeProvider.test.tsx 100.00% <100.00%> (ø)
packages/theme/src/ThemeProvider.tsx 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

interface ThemeProviderProps {
children: React.ReactNode;
theme?: ThemeColor;
children?: React.ReactNode;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 children optional로 바꾼 이유가 뭐예용?


- `ThemeProvider` now applies themes via `data-theme` attribute instead of `assignInlineVars`
- `theme` prop changed from brand-color objects to `'light' | 'dark'` string union
- `ColorTheme` type is now exported from `@sipe-team/tokens`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실제 export 되는건 ThemeMode 아닌가요??

'700': `${fontSize[32]}px`,
'800': `${fontSize[36]}px`,
'900': `${fontSize[48]}px`,
'050': cssVar('typography-font-size-12'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flow를 잘 이해 못 한거 같은데 여기서 var(--변수) 참조를 선언하고 값은 어디서 가져오는건가요?

mode: 'dark',
theme: '4th',
color: darkColor,
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 data-theme="light" 는 없는데 이유가 있을까요..?
ThemeMode 에는 light | dark 가 정의되어 있는데. dark 만 있어서요.
게다가 root 도 darkColor 로 fallback 되는데.

아니면 다음에 진행할 거라면,
ThemeMode 에서 light 는 삭제하거나 임시 주석을 넣어주는 게 좋을 것 같습니다.

Comment thread .claude/settings.json
"Write",
"Read"
"Read",
"Read(./packages/tokens/dist/*)"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 dist/** 로 해야하지 않을까요...?
dist/* 면 1 depth 만 매칭되는데요.

Comment thread .claude/settings.json
],
"ask": ["Bash(git push*)", "Bash(git commit*)", "Bash(git reset*)", "Bash(rm *)"],
"deny": [
"Read(**/dist/**)",
Copy link
Copy Markdown
Collaborator

@G-hoon G-hoon May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deny 가 allow 보다 우선되므로,
Read(**/dist/**)가 Read(./packages/tokens/dist/*) 허용을 덮어써 tokens/dist 읽기가 막힐 수 있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants