Skip to content

[INIT] 디자인 시스템 토큰 및 스토리 세팅 - #44

Merged
kimminna merged 22 commits into
developfrom
init/ui/41-design-system
Jun 29, 2026
Merged

[INIT] 디자인 시스템 토큰 및 스토리 세팅#44
kimminna merged 22 commits into
developfrom
init/ui/41-design-system

Conversation

@yumin-kim2

@yumin-kim2 yumin-kim2 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

ISSUE 🔗

close #41



What is this PR? 🔍

Figma 디자인 시스템 명세를 기준으로 Tailwind v4 디자인 토큰과 Storybook 검증 환경을 초기 설정했어요.

이번 PR에서는 color, typography, radius 토큰을 역할별 파일로 분리하고, 디자인 시스템 패키지와 timo-web에서 동일한 토큰을 사용할 수 있도록 구성했습니다.
또한 Storybook에서 토큰이 실제로 렌더링되는지 확인할 수 있도록 Color/Typography 스토리를 추가했습니다.

주요 변경 사항

  • Tailwind v4 @theme 기반 디자인 토큰을 추가했습니다.

    • color
    • typography
    • radius
  • 토큰 파일을 역할별로 분리했습니다.

    • tokens/colors.css
    • tokens/typography.css
    • tokens/radius.css
  • theme.css는 각 토큰 파일을 불러오는 진입점 역할만 하도록 정리했습니다.

  • 디자인 시스템 패키지에서 Tailwind가 적용되도록 Storybook 전역 스타일을 설정했습니다.

    • @import "tailwindcss"
    • @import "@repo/tailwind-config/theme.css"
    • 패키지 내부 PostCSS 설정 추가
  • Pretendard 폰트를 적용했습니다.

    • timo-web: Next localFont를 루트 레이아웃에서 적용
    • timo-design-system: Storybook 환경에서 @font-face로 적용
  • 타이포그래피 토큰 적용 방식을 수정했습니다.

    • text-* 충돌 가능성을 피하기 위해 typo-* 네이밍 사용
    • @utility typo-*font-size, line-height, letter-spacing, font-weight 적용
    • Typography 스토리에서 className={token}으로 실제 토큰 적용 확인
  • Storybook에서 디자인 토큰을 확인할 수 있도록 토큰 스토리를 추가했습니다.

    • Tokens/Color
    • Tokens/Typography

참고 사항

  • 이번 PR은 디자인 시스템 토큰 초기 세팅 범위입니다.
  • Tailwind v4 기준이라 tailwind.config.ts가 아니라 CSS @theme / @utility 방식으로 토큰을 정의했습니다.
  • 전역 html { font-size: 62.5%; } 설정은 Tailwind 기본 스케일과 접근성 측면을 고려해 제거하고, Figma 명세 값은 px 기준으로 정의했습니다.
  • Storybook 빌드 산출물이 lint 대상에 포함되지 않도록 제외했습니다.
/** @type {import("eslint").Linter.Config} */
export default [
  {
    ignores: ["storybook-static/**"],
  },
  ...config,
];



To Reviewers

토큰 네이밍과 파일 분리 기준 위주로 봐주시면 좋을 것 같아요.

특히 theme.css는 import 진입점으로만 두고, 실제 토큰은 colors, typography, radius 파일로 나눴습니다. 앞으로 토큰이 늘어날 때도 이 구조로 가져가도 괜찮을지 확인 부탁드립니다!

또한 타이포그래피 토큰은 text-* 대신 typo-* 유틸리티로 분리했습니다. cn/Tailwind merge 계열 유틸과 충돌 가능성을 줄이기 위한 방향인데, 이 네이밍 기준도 함께 확인 부탁드립니다.

Storybook의 Tokens/Color, Tokens/Typography 화면이 Chromatic 검증용으로 적절한지도 함께 봐주시면 감사하겠습니다!



Screenshot 📷

image

패키지 컴포넌트 앱에서 import/render 확인



Test Checklist ✔

  • pnpm lint 통과
  • git diff --check 통과
  • pnpm check-types 통과
  • Storybook에서 Tailwind 적용 확인
  • Storybook에서 디자인 시스템 토큰 적용 확인
  • Storybook DevTools Computed에서 typography token 적용 확인
  • 패키지 컴포넌트 앱에서 import/render 확인

@yumin-kim2 yumin-kim2 linked an issue Jun 28, 2026 that may be closed by this pull request
4 tasks
@yumin-kim2
yumin-kim2 requested a review from jjangminii as a code owner June 28, 2026 07:46
@github-actions github-actions Bot added ⏰ Timo-web Timo 웹 서비스 ⌚ Timo-Design-system Timo 디자인 시스템 labels Jun 28, 2026
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

워크스루

Tailwind 테마 토큰을 분리해 전역 스타일과 폰트 구성을 연결했고, 디자인 시스템의 색상·타이포그래피 토큰과 컴포넌트를 새 스키마에 맞게 갱신했습니다. Storybook과 ESLint 설정도 함께 정리했습니다.

변경 사항

디자인 시스템 토큰 및 스타일 세팅

Layer / File(s) Summary
Tailwind 토큰 파일 분리
packages/tailwind-config/theme.css, packages/tailwind-config/tokens/colors.css, packages/tailwind-config/tokens/typography.css, packages/tailwind-config/tokens/radius.css
theme.css가 외부 토큰 CSS를 @import로 불러오도록 바뀌고, 색상·타이포그래피·반경 토큰이 각 파일의 @theme 블록으로 분리됩니다.
토큰 타입과 데이터 갱신
packages/timo-design-system/src/tokens/color-token.ts, packages/timo-design-system/src/tokens/typography-token.ts
ColorTokenCOLOR_TOKENS가 추가되고, TypographyTokenTYPOGRAPHY_TOKENSusage 기반 구조에서 lineHeight·letterSpacing 기반 구조로 바뀝니다.
색상·타이포그래피 컴포넌트 갱신
packages/timo-design-system/src/components/color/Color.tsx, packages/timo-design-system/src/components/color/Color.stories.tsx, packages/timo-design-system/src/components/typography/Typography.tsx, packages/timo-design-system/src/components/typography/Typography.stories.tsx, packages/timo-design-system/src/components/index.ts
ColorTypography가 새 토큰 필드를 사용하도록 바뀌고, usage 렌더링이 제거되며, 스토리의 import 경로와 폰트 스타일이 함께 조정됩니다.
전역 폰트와 Storybook/빌드 연결
apps/timo-web/app/fonts.ts, apps/timo-web/app/layout.tsx, packages/timo-design-system/src/styles/globals.css, packages/timo-design-system/.storybook/preview.ts, packages/timo-design-system/package.json, packages/timo-design-system/postcss.config.mjs
Pretendard 로컬 폰트 정의와 전역 CSS가 추가되고, app layout과 Storybook preview가 이를 로드합니다. Tailwind/PostCSS 의존성도 함께 추가됩니다.
Storybook 정적 산출물 제외
packages/timo-design-system/eslint.config.mjs
ESLint 기본 export가 배열로 바뀌고 storybook-static/**가 무시 경로에 추가됩니다.

예상 코드 리뷰 노력

🎯 3 (Moderate) | ⏱️ ~25 minutes

관련 PR

  • Team-Timo/Timo-client#32: packages/tailwind-config/theme.css와 분리된 토큰 파일 구성 변경이 직접 이어집니다.
  • Team-Timo/Timo-client#43: Color/Typography 토큰 구조와 컴포넌트 시그니처 변경이 같은 영역을 갱신합니다.
  • Team-Timo/Timo-client#25: Storybook 전역 설정 파일을 함께 다루는 점에서 직접적인 연결이 있습니다.

추천 레이블

✨ Feature

추천 리뷰어

  • ehye1
  • jjangminii
  • kimminna
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 디자인 시스템 토큰 추가와 스토리 세팅이라는 핵심 변경을 잘 요약합니다.
Linked Issues check ✅ Passed [#41] 색상·타이포그래피·radius 토큰과 Pretendard 폰트, Storybook 스토리까지 추가되어 세팅 요구를 충족합니다.
Out of Scope Changes check ✅ Passed ESLint, PostCSS, 폰트, 스토리북 설정은 토큰/스토리 검증을 위한 보조 작업으로 보이며 명백한 범위 이탈은 없습니다.
Description check ✅ Passed 설명이 Tailwind v4 디자인 토큰 분리, Storybook 세팅, Pretendard 적용 등 변경 내용과 잘 맞습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch init/ui/41-design-system

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

@github-actions github-actions Bot added 🛠️ Setup 프로젝트 초기 설정 및 환경 구축 ♣️ 유민 유민양 labels Jun 28, 2026
@github-actions

Copy link
Copy Markdown

Timo Performance Report

Bundle Size — timo-web
라우트 크기 First Load JS
/ 0 B 🟡 205.30 kB
/focus 0 B 🟡 205.30 kB
/home 0 B 🟡 205.30 kB
/login 0 B 🟡 205.30 kB
/onboarding 0 B 🟡 205.30 kB
/settings 0 B 🟡 205.30 kB
/settings/account 0 B 🟡 205.30 kB
/settings/policy 0 B 🟡 205.30 kB
/statistics 0 B 🟡 205.30 kB
/today 0 B 🟡 205.30 kB

공유 번들: 205.30 kB
🟢 < 200kB  |  🟡 < 350kB  |  🔴 ≥ 350kB (First Load JS · gzip)

Lighthouse — timo-web

⚠️ Lighthouse 결과를 가져오지 못했습니다.

Image Optimization — timo-web

public/ 디렉토리에 이미지가 없습니다.

측정 커밋: 8925135

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/tailwind-config/tokens/typography.css`:
- Line 2: The --font-pretendard token currently defines only Pretendard, so
update the typography token in the font variables setup to include a safe
fallback stack. Locate the --font-pretendard declaration in the typography token
file and change it to use Pretendard with a generic sans-serif fallback so any
consumers of this token keep a usable font when the webfont fails to load.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c4803a7a-da41-4987-8022-e2ef82b64b6f

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffc3a5 and d7cf0c0.

📒 Files selected for processing (6)
  • apps/timo-web/app/globals.css
  • packages/tailwind-config/theme.css
  • packages/tailwind-config/tokens/colors.css
  • packages/tailwind-config/tokens/radius.css
  • packages/tailwind-config/tokens/typography.css
  • packages/timo-design-system/eslint.config.mjs

Comment thread packages/tailwind-config/tokens/typography.css Outdated
@@ -0,0 +1,86 @@
@theme {
--font-pretendard: Pretendard, sans-serif;

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.

https://nextjs-ko.org/docs/pages/building-your-application/optimizing/fonts
위 링크 참고해서 Next/local 폰트 최적화 적용해 주면 좋을 것 같아요-!!!

@jjangminii jjangminii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨어요! 간단한 코멘트 확인해주세요

Comment thread apps/timo-web/app/globals.css
Comment thread packages/tailwind-config/tokens/colors.css
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Storybook Preview

항목 링크
Storybook 열기
Chromatic 빌드 확인

마지막 업데이트: 2026-06-29 01:45 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/timo-design-system/src/components/color/Color.stories.tsx`:
- Line 2: `Color.stories.tsx` is using a deep relative import for
`COLOR_TOKENS`, which should be aligned with the project’s absolute alias import
convention. Update the import to use the same alias style used elsewhere in the
design system instead of `../../tokens/color-token`, so the Storybook story
remains resilient to file moves and consistent with the import rules.
- Around line 18-26: The Color.stories render wrapper currently uses a top-level
div, which violates the requested Fragment-first and semantic-container pattern.
Update the render function in Color.stories so the outermost wrapper is a
Fragment, and move the styling currently on the div to a semantic container such
as section while keeping the existing content and COLOR_TOKENS mapping intact.

In `@packages/timo-design-system/src/components/color/Color.tsx`:
- Line 1: The import in Color.tsx uses a deep relative path to ColorToken, which
should be replaced with the package’s absolute path alias to match the import
convention. Update the ColorToken import in the Color component to use the
existing alias used elsewhere in the design system instead of
"../../tokens/color-token", keeping the symbol ColorToken unchanged.
- Around line 4-38: The Color component currently uses nested divs for the whole
token card, but it should be refactored to use a Fragment as the top-level
wrapper and a semantic container like article for the main block. Update the
structure in Color to replace the non-semantic layout with appropriate semantic
tags, and move the name/cssVar/value metadata into a dl-based definition list so
the token details are easier to scan and navigate. Keep the visual styling
equivalent while reducing unnecessary div usage.
- Around line 1-3: `Color` 컴포넌트의 public API가 `ColorToken`을 직접 노출하고 있으므로, 입력 계약을
`ColorProps` interface로 분리하세요. `Color` 시그니처에서 `ColorToken` 대신 `ColorProps`를
사용하고, 필요한 필드만 명시해 토큰 모델과 컴포넌트 계약을 분리해 주세요.

In
`@packages/timo-design-system/src/components/typography/Typography.stories.tsx`:
- Around line 17-25: The Typography.stories.tsx story currently uses a top-level
div and should be updated to follow the path rules and a11y guidance. In the
render function for Typography, wrap the content with a Fragment and replace the
outer container with a semantic element such as section, keeping the existing
styling and mapping over TYPOGRAPHY_TOKENS unchanged.
- Line 2: The Typography.stories.tsx import currently uses a deep relative path,
which should be replaced with the project’s absolute path alias. Update the
TYPOGRAPHY_TOKENS import to use the same alias-based import style used elsewhere
in the design system, and ensure any related imports in Typography.stories.tsx
follow this convention so the file no longer depends on "../../" paths.

In `@packages/timo-design-system/src/components/typography/Typography.tsx`:
- Line 1: Replace the deep relative import in Typography with the project’s path
alias import style. Update the TypographyToken import in Typography.tsx to use
the same absolute alias pattern used elsewhere in the codebase, rather than
"../../tokens/typography-token", so the module resolves through the shared
tokens alias.
- Around line 10-42: The Typography component’s root wrapper is using generic
divs where a Fragment and semantic markup are expected. Update the top-level
structure in Typography to return a Fragment, replace the outer layout wrapper
with an article, and present the token/value metadata with a dl-based structure
instead of nested divs. Keep the same visual layout while reducing div usage and
aligning the component with document-style semantics.
- Around line 1-9: The Typography component is using TypographyToken directly as
its props contract, but the component API should be separated from the token
model. Update Typography to accept a new interface named TypographyProps, with
the Props suffix, and use that interface in the Typography function signature
while keeping the existing fields (token, size, weight, lineHeight,
letterSpacing) aligned with the current component behavior.

In `@packages/timo-design-system/src/tokens/color-token.ts`:
- Around line 1-30: Add a stable id field to the ColorToken model so list items
are keyed by a unique identifier instead of name. Update COLOR_TOKENS in
ColorToken to include id values, then change Color.stories.tsx to use that id
for the dynamic list key and keep name only for display. Make sure the new
identifier is the symbol consumers rely on when rendering the token list.

In `@packages/timo-design-system/src/tokens/typography-token.ts`:
- Around line 1-122: The typography token shape currently lacks a stable
identifier, so consumers are forced to use token names as list keys. Update
TypographyToken and TYPOGRAPHY_TOKENS to include a unique id field, then switch
Typography.stories.tsx to render keys from that id instead of token. Keep token
as the display/name field and use id as the persistent list identifier so
renames do not affect the key contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36f1913f-389e-40ac-af58-ec4ca00a243a

📥 Commits

Reviewing files that changed from the base of the PR and between 1cc5238 and 04e55e3.

📒 Files selected for processing (6)
  • packages/timo-design-system/src/components/color/Color.stories.tsx
  • packages/timo-design-system/src/components/color/Color.tsx
  • packages/timo-design-system/src/components/typography/Typography.stories.tsx
  • packages/timo-design-system/src/components/typography/Typography.tsx
  • packages/timo-design-system/src/tokens/color-token.ts
  • packages/timo-design-system/src/tokens/typography-token.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/timo-design-system/src/components/color/Color.stories.tsx`:
- Line 2: `Color.stories.tsx` is using a deep relative import for
`COLOR_TOKENS`, which should be aligned with the project’s absolute alias import
convention. Update the import to use the same alias style used elsewhere in the
design system instead of `../../tokens/color-token`, so the Storybook story
remains resilient to file moves and consistent with the import rules.
- Around line 18-26: The Color.stories render wrapper currently uses a top-level
div, which violates the requested Fragment-first and semantic-container pattern.
Update the render function in Color.stories so the outermost wrapper is a
Fragment, and move the styling currently on the div to a semantic container such
as section while keeping the existing content and COLOR_TOKENS mapping intact.

In `@packages/timo-design-system/src/components/color/Color.tsx`:
- Line 1: The import in Color.tsx uses a deep relative path to ColorToken, which
should be replaced with the package’s absolute path alias to match the import
convention. Update the ColorToken import in the Color component to use the
existing alias used elsewhere in the design system instead of
"../../tokens/color-token", keeping the symbol ColorToken unchanged.
- Around line 4-38: The Color component currently uses nested divs for the whole
token card, but it should be refactored to use a Fragment as the top-level
wrapper and a semantic container like article for the main block. Update the
structure in Color to replace the non-semantic layout with appropriate semantic
tags, and move the name/cssVar/value metadata into a dl-based definition list so
the token details are easier to scan and navigate. Keep the visual styling
equivalent while reducing unnecessary div usage.
- Around line 1-3: `Color` 컴포넌트의 public API가 `ColorToken`을 직접 노출하고 있으므로, 입력 계약을
`ColorProps` interface로 분리하세요. `Color` 시그니처에서 `ColorToken` 대신 `ColorProps`를
사용하고, 필요한 필드만 명시해 토큰 모델과 컴포넌트 계약을 분리해 주세요.

In
`@packages/timo-design-system/src/components/typography/Typography.stories.tsx`:
- Around line 17-25: The Typography.stories.tsx story currently uses a top-level
div and should be updated to follow the path rules and a11y guidance. In the
render function for Typography, wrap the content with a Fragment and replace the
outer container with a semantic element such as section, keeping the existing
styling and mapping over TYPOGRAPHY_TOKENS unchanged.
- Line 2: The Typography.stories.tsx import currently uses a deep relative path,
which should be replaced with the project’s absolute path alias. Update the
TYPOGRAPHY_TOKENS import to use the same alias-based import style used elsewhere
in the design system, and ensure any related imports in Typography.stories.tsx
follow this convention so the file no longer depends on "../../" paths.

In `@packages/timo-design-system/src/components/typography/Typography.tsx`:
- Line 1: Replace the deep relative import in Typography with the project’s path
alias import style. Update the TypographyToken import in Typography.tsx to use
the same absolute alias pattern used elsewhere in the codebase, rather than
"../../tokens/typography-token", so the module resolves through the shared
tokens alias.
- Around line 10-42: The Typography component’s root wrapper is using generic
divs where a Fragment and semantic markup are expected. Update the top-level
structure in Typography to return a Fragment, replace the outer layout wrapper
with an article, and present the token/value metadata with a dl-based structure
instead of nested divs. Keep the same visual layout while reducing div usage and
aligning the component with document-style semantics.
- Around line 1-9: The Typography component is using TypographyToken directly as
its props contract, but the component API should be separated from the token
model. Update Typography to accept a new interface named TypographyProps, with
the Props suffix, and use that interface in the Typography function signature
while keeping the existing fields (token, size, weight, lineHeight,
letterSpacing) aligned with the current component behavior.

In `@packages/timo-design-system/src/tokens/color-token.ts`:
- Around line 1-30: Add a stable id field to the ColorToken model so list items
are keyed by a unique identifier instead of name. Update COLOR_TOKENS in
ColorToken to include id values, then change Color.stories.tsx to use that id
for the dynamic list key and keep name only for display. Make sure the new
identifier is the symbol consumers rely on when rendering the token list.

In `@packages/timo-design-system/src/tokens/typography-token.ts`:
- Around line 1-122: The typography token shape currently lacks a stable
identifier, so consumers are forced to use token names as list keys. Update
TypographyToken and TYPOGRAPHY_TOKENS to include a unique id field, then switch
Typography.stories.tsx to render keys from that id instead of token. Keep token
as the display/name field and use id as the persistent list identifier so
renames do not affect the key contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36f1913f-389e-40ac-af58-ec4ca00a243a

📥 Commits

Reviewing files that changed from the base of the PR and between 1cc5238 and 04e55e3.

📒 Files selected for processing (6)
  • packages/timo-design-system/src/components/color/Color.stories.tsx
  • packages/timo-design-system/src/components/color/Color.tsx
  • packages/timo-design-system/src/components/typography/Typography.stories.tsx
  • packages/timo-design-system/src/components/typography/Typography.tsx
  • packages/timo-design-system/src/tokens/color-token.ts
  • packages/timo-design-system/src/tokens/typography-token.ts
🛑 Comments failed to post (12)
packages/timo-design-system/src/components/color/Color.stories.tsx (2)

2-2: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

깊은 상대 경로 import는 절대 경로 alias로 통일해 주세요.

../../tokens/color-token는 이동에 취약하고 현재 import 규칙과도 어긋납니다. Storybook에서도 같은 alias를 쓰도록 맞춰 두면 토큰 경로가 다시 바뀌어도 수정 범위가 줄어듭니다.

As per path instructions, 절대 경로 import 사용 (상대 경로 ../../ 지양).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.stories.tsx` at line
2, `Color.stories.tsx` is using a deep relative import for `COLOR_TOKENS`, which
should be aligned with the project’s absolute alias import convention. Update
the import to use the same alias style used elsewhere in the design system
instead of `../../tokens/color-token`, so the Storybook story remains resilient
to file moves and consistent with the import rules.

Source: Path instructions


18-26: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

최상단 래퍼는 Fragment로, 실제 컨테이너는 시맨틱 태그로 바꿔 주세요.

현재 루트가 <div>라서 두 규칙을 동시에 놓치고 있습니다. 최상단은 <>...</>로 두고, 스타일이 필요한 컨테이너는 <section> 같은 시맨틱 요소로 내려 주세요. 작은 차이인데 문서 구조가 덜 밋밋해집니다.

As per path instructions, 최상단 래퍼는 Fragment: <>…</> and div 남발 금지 → main, article, section, nav, header, footer 등 시맨틱 태그 사용.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.stories.tsx` around
lines 18 - 26, The Color.stories render wrapper currently uses a top-level div,
which violates the requested Fragment-first and semantic-container pattern.
Update the render function in Color.stories so the outermost wrapper is a
Fragment, and move the styling currently on the div to a semantic container such
as section while keeping the existing content and COLOR_TOKENS mapping intact.

Source: Path instructions

packages/timo-design-system/src/components/color/Color.tsx (3)

1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

깊은 상대 경로 import는 절대 경로 alias로 바꿔 주세요.

../../tokens/color-token는 현재 import 규칙과 맞지 않습니다. 디자인 시스템 패키지 안에서 경로 alias를 일관되게 쓰는 편이 구조 변경 때 훨씬 덜 아픕니다.

As per path instructions, 절대 경로 import 사용 (상대 경로 ../../ 지양).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.tsx` at line 1, The
import in Color.tsx uses a deep relative path to ColorToken, which should be
replaced with the package’s absolute path alias to match the import convention.
Update the ColorToken import in the Color component to use the existing alias
used elsewhere in the design system instead of "../../tokens/color-token",
keeping the symbol ColorToken unchanged.

Source: Path instructions


1-3: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

컴포넌트 입력 계약은 ColorProps 인터페이스로 분리해 주세요.

ColorToken은 토큰 데이터 모델인데, 지금은 그 타입이 그대로 컴포넌트 public API가 됩니다. interface ColorProps로 한 번 분리해 두면 규칙도 지키고 토큰 스키마 변경이 컴포넌트 계약으로 바로 번지는 것도 막을 수 있습니다.

예시
 import { ColorToken } from "../../tokens/color-token";
 
-export const Color = ({ name, cssVar, value }: ColorToken) => {
+export interface ColorProps extends ColorToken {}
+
+export const Color = ({ name, cssVar, value }: ColorProps) => {

As per path instructions, Props 타입은 interface로 선언하고 접미사 Props 사용.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import { ColorToken } from "../../tokens/color-token";

export interface ColorProps extends ColorToken {}

export const Color = ({ name, cssVar, value }: ColorProps) => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.tsx` around lines 1 -
3, `Color` 컴포넌트의 public API가 `ColorToken`을 직접 노출하고 있으므로, 입력 계약을 `ColorProps`
interface로 분리하세요. `Color` 시그니처에서 `ColorToken` 대신 `ColorProps`를 사용하고, 필요한 필드만 명시해
토큰 모델과 컴포넌트 계약을 분리해 주세요.

Source: Path instructions


4-38: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

루트 구조를 Fragment + 시맨틱 마크업으로 정리해 주세요.

토큰 한 항목을 설명하는 UI라서 최상단은 Fragment로 두고, 실제 컨테이너는 <article> 같은 시맨틱 요소가 더 잘 맞습니다. 내부 메타데이터도 <dl> 구조로 바꾸면 문서 탐색성이 좋아집니다. 지금은 div가 너무 열일합니다.

As per path instructions, 최상단 래퍼는 Fragment: <>…</> and div 남발 금지 → main, article, section, nav, header, footer 등 시맨틱 태그 사용.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.tsx` around lines 4 -
38, The Color component currently uses nested divs for the whole token card, but
it should be refactored to use a Fragment as the top-level wrapper and a
semantic container like article for the main block. Update the structure in
Color to replace the non-semantic layout with appropriate semantic tags, and
move the name/cssVar/value metadata into a dl-based definition list so the token
details are easier to scan and navigate. Keep the visual styling equivalent
while reducing unnecessary div usage.

Source: Path instructions

packages/timo-design-system/src/components/typography/Typography.stories.tsx (2)

2-2: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

깊은 상대 경로 import는 절대 경로 alias로 통일해 주세요.

../../tokens/typography-token는 현재 import 규칙과 어긋납니다. 토큰 파일 분리가 계속될수록 alias가 유지보수 비용을 더 잘 막아 줍니다.

As per path instructions, 절대 경로 import 사용 (상대 경로 ../../ 지양).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.stories.tsx`
at line 2, The Typography.stories.tsx import currently uses a deep relative
path, which should be replaced with the project’s absolute path alias. Update
the TYPOGRAPHY_TOKENS import to use the same alias-based import style used
elsewhere in the design system, and ensure any related imports in
Typography.stories.tsx follow this convention so the file no longer depends on
"../../" paths.

Source: Path instructions


17-25: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

최상단 래퍼는 Fragment로, 실제 컨테이너는 시맨틱 태그로 바꿔 주세요.

현재 루트가 <div>라서 경로 규칙과 a11y 규칙을 동시에 놓칩니다. 최상단은 Fragment로 두고, 본문 컨테이너는 <section> 같은 시맨틱 요소로 바꾸는 편이 더 일관됩니다.

As per path instructions, 최상단 래퍼는 Fragment: <>…</> and div 남발 금지 → main, article, section, nav, header, footer 등 시맨틱 태그 사용.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.stories.tsx`
around lines 17 - 25, The Typography.stories.tsx story currently uses a
top-level div and should be updated to follow the path rules and a11y guidance.
In the render function for Typography, wrap the content with a Fragment and
replace the outer container with a semantic element such as section, keeping the
existing styling and mapping over TYPOGRAPHY_TOKENS unchanged.

Source: Path instructions

packages/timo-design-system/src/components/typography/Typography.tsx (3)

1-1: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

깊은 상대 경로 import는 절대 경로 alias로 바꿔 주세요.

../../tokens/typography-token는 현재 import 규칙과 맞지 않습니다. 토큰 구조가 더 분리될수록 alias가 경로 churn을 줄여 줍니다.

As per path instructions, 절대 경로 import 사용 (상대 경로 ../../ 지양).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.tsx` at line
1, Replace the deep relative import in Typography with the project’s path alias
import style. Update the TypographyToken import in Typography.tsx to use the
same absolute alias pattern used elsewhere in the codebase, rather than
"../../tokens/typography-token", so the module resolves through the shared
tokens alias.

Source: Path instructions


1-9: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

컴포넌트 입력 계약은 TypographyProps 인터페이스로 분리해 주세요.

TypographyToken을 그대로 props에 쓰면 토큰 데이터 모델과 컴포넌트 API가 한 덩어리로 묶입니다. interface TypographyProps로 분리해 두면 규칙을 지키면서도 두 경계가 더 선명해집니다.

예시
 import { TypographyToken } from "../../tokens/typography-token";
 
+export interface TypographyProps extends TypographyToken {}
+
 export const Typography = ({
   token,
   size,
   weight,
   lineHeight,
   letterSpacing,
-}: TypographyToken) => {
+}: TypographyProps) => {

As per path instructions, Props 타입은 interface로 선언하고 접미사 Props 사용.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import { TypographyToken } from "../../tokens/typography-token";

export interface TypographyProps extends TypographyToken {}

export const Typography = ({
  token,
  size,
  weight,
  lineHeight,
  letterSpacing,
}: TypographyProps) => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.tsx` around
lines 1 - 9, The Typography component is using TypographyToken directly as its
props contract, but the component API should be separated from the token model.
Update Typography to accept a new interface named TypographyProps, with the
Props suffix, and use that interface in the Typography function signature while
keeping the existing fields (token, size, weight, lineHeight, letterSpacing)
aligned with the current component behavior.

Source: Path instructions


10-42: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

루트 구조를 Fragment + 시맨틱 마크업으로 바꿔 주세요.

이 컴포넌트는 타이포 샘플과 메타정보를 보여 주는 문서성 블록이라 <article><dl>이 더 잘 맞습니다. 최상단도 Fragment로 맞춰 두면 규칙이 일관되고, div 의존도도 줄어듭니다. 지금 구조는 조금 너무 편한 길로 갔습니다.

As per path instructions, 최상단 래퍼는 Fragment: <>…</> and div 남발 금지 → main, article, section, nav, header, footer 등 시맨틱 태그 사용.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.tsx` around
lines 10 - 42, The Typography component’s root wrapper is using generic divs
where a Fragment and semantic markup are expected. Update the top-level
structure in Typography to return a Fragment, replace the outer layout wrapper
with an article, and present the token/value metadata with a dl-based structure
instead of nested divs. Keep the same visual layout while reducing div usage and
aligning the component with document-style semantics.

Source: Path instructions

packages/timo-design-system/src/tokens/color-token.ts (1)

1-30: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

토큰 모델에 id를 넣어 story 리스트 key를 규칙에 맞춰 주세요.

현재 구조에서는 소비처가 token.namekey로 쓸 수밖에 없습니다. 동적 리스트는 고유 id를 쓰라는 규칙이 있으니 ColorTokenid를 추가하고 Color.stories.tsx도 그 필드를 사용하도록 맞춰 주세요. 표시명과 식별자를 분리해 두면 이름 변경에도 더 안전합니다.

예시
 export interface ColorToken {
+  id: string;
   name: string;
   cssVar: string;
   value: string;
 }
 
 export const COLOR_TOKENS: ColorToken[] = [
-  { name: "timo-blue-50", cssVar: "--color-timo-blue-50", value: "`#F1F6FE`" },
+  { id: "timo-blue-50", name: "timo-blue-50", cssVar: "--color-timo-blue-50", value: "`#F1F6FE`" },

As per path instructions, 동적 리스트의 key prop: 반드시 고유 id 사용 (index 금지).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/tokens/color-token.ts` around lines 1 - 30,
Add a stable id field to the ColorToken model so list items are keyed by a
unique identifier instead of name. Update COLOR_TOKENS in ColorToken to include
id values, then change Color.stories.tsx to use that id for the dynamic list key
and keep name only for display. Make sure the new identifier is the symbol
consumers rely on when rendering the token list.

Source: Path instructions

packages/timo-design-system/src/tokens/typography-token.ts (1)

1-122: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

토큰 항목에 id를 추가해 리스트 key 계약을 맞춰 주세요.

현재 구조에서는 소비처가 row.tokenkey로 쓸 수밖에 없습니다. 동적 리스트는 고유 id를 쓰라는 규칙이 있으니 TypographyTokenid를 추가하고 Typography.stories.tsx도 그 필드를 사용하도록 맞춰 주세요. 이름과 렌더링 식별자를 분리해 두면 토큰 rename에도 덜 흔들립니다.

예시
 export interface TypographyToken {
+  id: string;
   token: string;
   size: string;
   weight: string;
   lineHeight: string;
   letterSpacing: string;
 }
 
 export const TYPOGRAPHY_TOKENS: TypographyToken[] = [
   {
+    id: "text-headline-b-30",
     token: "text-headline-b-30",

As per path instructions, 동적 리스트의 key prop: 반드시 고유 id 사용 (index 금지).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/tokens/typography-token.ts` around lines 1 -
122, The typography token shape currently lacks a stable identifier, so
consumers are forced to use token names as list keys. Update TypographyToken and
TYPOGRAPHY_TOKENS to include a unique id field, then switch
Typography.stories.tsx to render keys from that id instead of token. Keep token
as the display/name field and use id as the persistent list identifier so
renames do not affect the key contract.

Source: Path instructions

@yumin-kim2 yumin-kim2 changed the title [INIT] 디자인 시스템 세팅 [INIT] 디자인 시스템 세팅 및 스토리 세팅 Jun 28, 2026
@yumin-kim2 yumin-kim2 changed the title [INIT] 디자인 시스템 세팅 및 스토리 세팅 [INIT] 디자인 시스템 토큰 및 스토리 세팅 Jun 28, 2026
@jjangminii

Copy link
Copy Markdown
Contributor

1. Tailwind는 이미 px 계산을 추상화한다.

p-4 = 16px, text-base = 1rem <- 직접 rem을 계산할 일이 없습니다.

2. Tailwind의 기본값이 깨진다

Tailwind는 브라우저 기본값 1rem = 16px 로 설계되어 있기 때문에 10px로 바꾸게 된다면 text-base, text-sm 등 타이포그래피 클래스가 전부 의도와 다르게 렌더링됩니다.

3. 접근성 위반

사용자가 브라우저에서 기본 폰트 크기를 크게 설정해 놔도 62.5% 로 덮어쓰게 돼요. rem의 존재 이유 자체를 무시하게 되는 것과 같은 것 같습니다.

4. 반응형 설계 관점

추후 태블릿, 모바일 전용 디자인이 별도로 나올 예정이고, 뷰포트별로 타이포 토큰도 따로 적용될 예정이에요. 이 경우 반응형 분기는 Tailwind 브레이크 포인트를 이용하는 것이 맞고, 이때 1rem = 10px 설정은 토큰 기반 타이포 스케일이 breakpoint 마다 올바르게 동작하는 걸 방해합니다.

확실히 Tailwind는 유틸리티 클래스 내부에서 이미 rem 기반으로 값을 정의하고 있어서, font-size: 62.5%를 별도로 설정하지 않는 게 더 안전할 것 같아요. 저는 바닐라 CSS부터 접하다 보니 1rem = 10px로 맞춰두는 게 당연한 관행인 줄 알고 있었는데, Tailwind 환경에서는 text-sm, p-4 같은 클래스 자체가 이미 rem 계산을 추상화해주고 있어서 오히려 62.5%를 적용하면 Tailwind가 의도한 스케일이 전부 틀어지는 거였네요...
몰랐던 부분 많이 배워갑니다 👍 👍 💯

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/timo-design-system/src/components/color/Color.stories.tsx (1)

1-2: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

상대 경로 import를 alias로 바꿔 주세요. ../../tokens/color-token은 이 저장소의 절대 경로 import 규칙과 어긋납니다. @/...로 맞추고, 필요하면 TypeScript baseUrl/paths 문서도 참고해 보세요: https://www.typescriptlang.org/tsconfig/#paths 토큰은 잘 찾았고, 경로만 한 번 더 다듬으면 됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/color/Color.stories.tsx` around
lines 1 - 2, The import in Color.stories.tsx should use the repository’s
alias-based absolute path instead of a relative path. Update the COLOR_TOKENS
import to follow the existing `@/`... import convention used in this codebase, and
keep the Color import unchanged if it already matches the local module pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/timo-design-system/src/components/color/Color.stories.tsx`:
- Around line 1-2: The import in Color.stories.tsx should use the repository’s
alias-based absolute path instead of a relative path. Update the COLOR_TOKENS
import to follow the existing `@/`... import convention used in this codebase, and
keep the Color import unchanged if it already matches the local module pattern.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c051b8a5-7b9b-4328-98b6-290c2b17d3bb

📥 Commits

Reviewing files that changed from the base of the PR and between af9db14 and 2a37467.

⛔ Files ignored due to path filters (3)
  • apps/timo-web/app/fonts/PretendardVariable.woff2 is excluded by !**/*.woff2
  • packages/timo-design-system/src/assets/fonts/PretendardVariable.woff2 is excluded by !**/*.woff2
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • apps/timo-web/app/fonts.ts
  • apps/timo-web/app/layout.tsx
  • packages/tailwind-config/tokens/typography.css
  • packages/timo-design-system/.storybook/preview.ts
  • packages/timo-design-system/package.json
  • packages/timo-design-system/postcss.config.mjs
  • packages/timo-design-system/src/components/color/Color.stories.tsx
  • packages/timo-design-system/src/components/index.ts
  • packages/timo-design-system/src/components/typography/Typography.stories.tsx
  • packages/timo-design-system/src/styles/globals.css

@yumin-kim2

Copy link
Copy Markdown
Contributor Author

리뷰 감사합니다! 말씀해주신 부분 확인해보니 1rem = 10px 기준을 만들기 위해 전역 html font-size62.5%로 바꾸는 방식은 Tailwind 기본 스케일과 접근성 측면에서 적절하지 않을 수 있다고 이해했습니다.

그래서 해당 전역 설정은 제거하고, 디자인 명세에 있는 타이포그래피 값은 px 단위로 직접 토큰화하는 방식으로 수정했습니다.

추가로 패키지 단위 디자인 시스템 검증을 위해 Storybook에서도 Tailwind config와 Pretendard 폰트가 정상 적용되도록 설정했고, 앱에서도 @repo/timo-design-system/ui 경로로 컴포넌트를 불러와 렌더링되는 것까지 확인했습니다-!

검증 완료한 항목은 다음과 같습니다.

  • Storybook 내 Tailwind 토큰 렌더링 확인
  • Storybook 내 Pretendard 폰트 적용 확인
  • Storybook 내 컬러 시스템 적용 확인
  • timo-web 내 Pretendard 적용 확인
  • timo-web에서 디자인 시스템 컴포넌트 import/render 확인
  • pnpm lint
  • pnpm --filter @repo/timo-design-system build-storybook
  • pnpm --filter timo-web check-types

임시 검증 코드는 제거하고 필요한 설정/토큰 변경만 커밋하겠습니당
리뷰 덕분에 놓쳤던 부분이랑 새로 알게된 부분, 너무너무 많이 배워가요 감사합니다!!!!!!!! 🫰🏻🫰🏻

@kimminna kimminna left a comment

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.

너무너무 고생했어여 유민양

Comment thread apps/timo-web/app/fonts.ts Outdated
Comment thread apps/timo-web/app/layout.tsx
@ahyohyo

ahyohyo commented Jun 28, 2026

Copy link
Copy Markdown

너무너무 고생했어요 유민양 ~~ 짱 멋져요 ❤️

Comment thread packages/timo-design-system/src/styles/globals.css
@yumin-kim2

yumin-kim2 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

타이포그래피 토큰 적용 방식 수정했습니다!

기존에는 Typography 스토리에서 토큰명을 보여주고 있었지만, 실제 샘플 텍스트에는 fontSize, fontWeight, lineHeight, letterSpacing을 inline style로 직접 적용하고 있었습니다. 그래서 Storybook에서 디자인 시스템의 타이포 토큰 유틸리티가 실제 샘플 텍스트에 적용되지 않는 상태였습니다.

수정 내용은 아래와 같습니다.

  • text-* 대신 typo-* 네이밍으로 타이포 유틸리티를 분리했습니다.
  • cn/Tailwind merge 계열 유틸과 충돌하지 않도록 @utility typo-*를 추가했습니다.
  • typography-token.ts의 토큰명도 typo-* 기준으로 맞췄습니다.
  • Typography 샘플 텍스트에 className={token}을 적용해서 실제 유틸리티 클래스가 렌더링되도록 수정했습니다.

확인 결과, Storybook DevTools에서 typo-headline-b-24 기준으로 font-size: 24px, font-weight: 700, line-height: 36px, letter-spacing: -0.72px, font-family: Pretendard가 정상 반영되는 것을 확인했습니다!🚀🚀
(수정 사항에 맞게 PR 수정 완료 했숩니다)

@ehye1 ehye1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

너무너무 수고많았어요 유민양,,
수정 사항에 맞춰서 pr도 같이 수정해주면 좋을 것 같아요!!!
고생햇서요 ♥️

- timo-design-system에 ./styles CSS 엔트리포인트 추가
- components.css에 @source로 컴포넌트 디렉토리 스캔 설정
- timo-web globals.css에서 디자인 시스템 스타일 import

@kimminna kimminna left a comment

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.

Storybook에서는 정상적으로 보이던 컴포넌트의 스타일이 timo-web에서는 적용되지 않는 문제가 있었는데요.

원인을 찾아보니,
Tailwind v4는 소스 파일을 스캔해서 사용된 클래스명에 해당하는 CSS만 생성합니다. timo-web의 Tailwind는 자기 프로젝트 파일만 스캔하고 node_modules 내부는 스캔하지 않기 때문에, timo-design-system 패키지 안의 bg-timo-yellow-300 같은 클래스를 인식하지 못해 CSS가 생성되지 않았어요. Storybook은 디자인 시스템 패키지 내부에서 실행되므로 자체 소스를 직접 스캔해 문제가 없었습니다.

가장 단순한 해결책은 timo-web/app/globals.css에 @source "../../../packages/timo-design-system/src"를 직접 추가하는 것이지만, 이 방식은 디자인 시스템 내부 경로를 소비하는 앱이 알아야 한다는 문제가 있습니다. DS 패키지 구조가 바뀌면 모든 소비 앱을 수정해야 합니다.

대신 디자인 시스템이 자체 CSS 엔트리포인트를 export하는 방식으로 구현했어요. 스캔 경로 관리 책임이 DS 패키지 내부에 위치하므로, 소비하는 앱은 @import "@repo/timo-design-system/styles" 한 줄만 추가하면 됩니다. 이후 새 컴포넌트가 src/components/ 아래에 추가되더라도 소비 앱을 수정할 필요가 없습니다.

빌드 스텝을 추가해 CSS를 미리 컴파일해서 export하는 방법도 있지만, 현재 프로젝트는 모노레포 내에서만 사용하는 소스 패키지 구조이므로 빌드 복잡도를 높이지 않는 이 방법이 적합하다고 판단했습니다!! 추후에 디자인 시스템을 아예 독립적으로 분리할 일이 생긴다면, 그때 dist 파일 내에 디자인 시스템 스타일을 생성해서 export 하는 방식으로 바꿔도 괜찮을 것 같아요.

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

Labels

⌚ Timo-Design-system Timo 디자인 시스템 ⏰ Timo-web Timo 웹 서비스 ♣️ 유민 유민양 🛠️ Setup 프로젝트 초기 설정 및 환경 구축

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[INIT] 디자인 시스템 세팅

5 participants