Skip to content

Conversation

@dasosann
Copy link
Contributor

@dasosann dasosann commented Jan 26, 2026

User description

요약

구현 사항

  • [ ]
  • [ ]
  • [ ]
  • [ ]

📸 스크린샷

Need Review

  • ~ 부분 이렇게 구현했어요, 피드백 부탁해요!

Reference

📜 리뷰 규칙

Reviewer는 아래 P5 Rule을 참고하여 리뷰를 진행합니다.
P5 Rule을 통해 Reviewer는 Reviewee에게 리뷰의 의도를 보다 정확히 전달할 수 있습니다.

  • P1: 꼭 반영해주세요 (Comment)
  • P2: 적극적으로 고려해주세요 (Comment)
  • P3: 웬만하면 반영해 주세요 (Comment)
  • P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
  • P5: 그냥 사소한 의견입니다 (Approve)

PR Type

Enhancement


Description

  • Implement automated token generation script from token.json

  • Create comprehensive CSS tokens file with design system variables

  • Update home page with design token showcase and examples

  • Configure VSCode to ignore unknown CSS at-rules


Diagram Walkthrough

flowchart LR
  A["token.json<br/>Design Tokens"] -- "parse & generate" --> B["generate-tokens.js<br/>Node Script"]
  B -- "creates" --> C["tokens.css<br/>CSS Variables"]
  C -- "imported by" --> D["globals.css<br/>Global Styles"]
  D -- "used in" --> E["page.tsx<br/>Home Page"]
  E -- "displays" --> F["Design Token<br/>Showcase"]
Loading

File Walkthrough

Relevant files
Enhancement
generate-tokens.js
Token generation script implementation                                     

scripts/generate-tokens.js

  • New Node.js script that parses token.json and generates CSS variables
  • Extracts semantic tokens (colors, grayscale, transparent) into CSS
    custom properties
  • Generates typography utilities with text-{size}-{weight} naming
    convention
  • Creates background, button, border, and text color utility classes
  • Includes token reference resolution for nested token values
+214/-0 
tokens.css
Generated design tokens CSS file                                                 

app/tokens.css

  • Auto-generated CSS file containing all design system tokens
  • Defines 60+ CSS custom properties for colors, radius, borders, and
    opacity
  • Provides 80+ typography utility classes for different font sizes and
    weights
  • Includes background, button, border, and text color utility classes
  • Organized using CSS @layer for proper cascade management
+260/-0 
page.tsx
Redesign home page with token examples                                     

app/page.tsx

  • Replaced boilerplate Next.js home page with design token showcase
  • Added comprehensive examples of typography, colors, and button styles
  • Demonstrates usage of generated utility classes and CSS variables
  • Organized into sections for typography, colors/backgrounds, and
    buttons
  • Removed unused Next.js Image imports and external links
+55/-57 
Configuration changes
globals.css
Import generated tokens into globals                                         

app/globals.css

  • Added import statement for newly generated tokens.css file
  • Changed single quotes to double quotes for consistency
  • Ensures design tokens are available globally in the application
+2/-1     
settings.json
Configure VSCode CSS linting settings                                       

.vscode/settings.json

  • Added "css.lint.unknownAtRules": "ignore" configuration
  • Suppresses VSCode warnings for custom CSS at-rules used in token
    generation
  • Improves developer experience by reducing false linting errors
+2/-1     
Miscellaneous
token.json
Remove old token.json from src directory                                 

app/src/token.json

  • Entire file removed (1279 lines deleted)
  • Token definitions moved to root-level app/token.json location
  • Consolidates token source to single location for generation script
+0/-1279

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dasosann, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 디자인 토큰 시스템을 도입하여 UI 요소의 표준화를 목표로 합니다. token.json 파일에서 tokens.css를 생성하는 자동화된 워크플로우를 구축하고, 이를 통해 색상, 타이포그래피, 간격 등 디자인 속성을 중앙에서 관리할 수 있게 합니다. page.tsx 파일은 이러한 새로운 토큰의 적용 사례를 보여주도록 업데이트되어, 디자인 일관성과 유지보수성을 향상시킵니다.

Highlights

  • 디자인 토큰 시스템 도입: 디자인 토큰을 프로젝트에 통합하여 token.json 파일로부터 tokens.css 파일을 생성하고 이를 전역 CSS에 임포트하도록 변경했습니다.
  • 토큰 자동 생성 스크립트 추가: token.json 파일을 파싱하여 CSS 변수 및 Tailwind 유틸리티 클래스를 포함하는 tokens.css 파일을 자동으로 생성하는 scripts/generate-tokens.js 스크립트를 새로 추가했습니다.
  • 메인 페이지 UI 업데이트: app/page.tsx 파일을 수정하여 새로 통합된 디자인 토큰(타이포그래피, 색상, 배경, 버튼)을 활용한 UI 데모 섹션을 추가했습니다.
  • VS Code 설정 업데이트: CSS 린트가 알 수 없는 @rules를 무시하도록 .vscode/settings.jsoncss.lint.unknownAtRules: "ignore" 설정을 추가했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 디자인 토큰을 관리하기 위해 token.json 파일과 이를 CSS 변수 및 유틸리티 클래스로 변환하는 generate-tokens.js 스크립트를 도입했습니다. 이를 통해 일관된 UI를 구축할 수 있는 기반을 마련한 점이 좋습니다. page.tsx에 토큰을 시연하는 테스트 페이지를 추가한 것도 좋은 시도입니다.

다만, 스크립트의 안정성과 유지보수성을 높이기 위한 몇 가지 개선점과, 테스트 페이지에서 토큰이 올바르게 사용되지 않고 있는 문제점들이 발견되었습니다. 특히, 버튼 스타일링이 적용되지 않는 심각한 버그가 있으니 수정이 필요합니다. 자세한 내용은 각 파일에 남긴 코멘트를 확인해주세요.

Comment on lines +47 to +57
<div className="flex flex-wrap gap-4">
<button className="btn-primary text-16-600 px-8 py-3 transition-opacity hover:opacity-90">
Primary Button
</button>
<button className="btn-slate text-brand-black border-light text-16-600 rounded-2xl border px-8 py-3">
Secondary Button
</button>
<button className="btn-disabled text-16-400 cursor-not-allowed px-8 py-3">
Disabled Button
</button>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

버튼 스타일링 문제 (버그 및 불일치)

버튼 컴포넌트에서 두 가지 주요 문제가 발견되었습니다.

  1. 존재하지 않는 클래스 사용 (버그): btn-primary, btn-slate, btn-disabled 클래스를 사용하고 있지만, 이 클래스들은 tokens.css에 정의되어 있지 않습니다. generate-tokens.js 스크립트는 bg-button-primary와 같은 배경색 유틸리티만 생성합니다. 이로 인해 버튼에 의도한 스타일이 전혀 적용되지 않는 심각한 버그가 발생합니다.

  2. 스타일 불일치: 버튼들의 border-radius 스타일이 일관되지 않습니다. Secondary 버튼에만 rounded-2xl이 적용되어 있고, 다른 버튼에는 rounded-* 클래스가 없습니다. token.json에 정의된 button-border-radius 토큰(radius-md, 16px)을 모든 버튼에 일관되게 적용해야 합니다.

제안:
tokens.css에 정의된 유틸리티 클래스들을 조합하여 모든 버튼에 일관된 스타일을 적용해주세요.

또한, 클래스 이름이 길어지고 있으므로, 코드 스타일 가이드라인(51번)에 따라 class-variance-authority (cva)를 사용하여 버튼 스타일을 컴포넌트 변형(variant)으로 관리하는 것을 적극적으로 고려해보세요. 이는 코드의 가독성과 유지보수성을 크게 향상시킬 것입니다.

// cva를 사용하지 않는 경우의 수정 예시
<button className="bg-button-primary text-white rounded-2xl text-16-600 px-8 py-3 transition-opacity hover:opacity-90">
  Primary Button
</button>
References
  1. Tailwind 클래스가 너무 길거나 복잡하면 class-variance-authority (cva) 또는 논리적 그룹핑을 제안하세요. (link)

<div className="bg-surface-base flex min-h-screen items-center justify-center font-sans">
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center gap-8 px-8 py-12">
{/* 토큰 테스트 섹션 */}
<div className="w-full space-y-8 rounded-lg border border-gray-200 bg-white p-8 shadow-sm">
Copy link
Contributor

Choose a reason for hiding this comment

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

high

토큰화되지 않은 클래스 사용

디자인 토큰 시스템을 도입했음에도 불구하고, border-gray-200, bg-white와 같이 토큰 시스템에 정의되지 않은 Tailwind 기본 클래스를 직접 사용하고 있습니다. 이는 디자인 시스템의 일관성을 해치고, 향후 테마(예: 다크 모드) 적용을 어렵게 만듭니다.

제안:
tokens.css에 정의된 유틸리티 클래스를 사용하도록 수정해주세요.

  • border-gray-200 대신 border-light 사용을 고려해보세요.
  • bg-white 대신 bg-surface-base 또는 카드 배경을 위한 새로운 토큰 기반 클래스 사용을 고려해보세요. (token.jsontheme.card.background에 해당하는 유틸리티가 필요해 보입니다.)

bg-gray-50(14번 줄) 등 다른 곳에서도 동일한 문제가 발견되니 함께 검토해주세요.

Comment on lines +107 to +111
// Grayscale 참조
if (ref.startsWith("Grayscale.")) {
const key = ref.replace("Grayscale.", "");
return `var(--${key})`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

resolveValue 함수의 안정성 문제

resolveValue 함수에서 토큰 참조를 해석할 때 sanitizeKey 함수를 사용하지 않아 잠재적인 버그가 발생할 수 있습니다.

현재 token.json의 참조 키(color-gray-64 등)는 이미 정제되어 있어 문제가 없지만, 만약 "My Color"와 같이 공백이나 대문자가 포함된 키가 참조될 경우 var(--My Color)와 같이 유효하지 않은 CSS가 생성됩니다.

제안:
resolveValue 함수 내부에서 키를 추출한 후 sanitizeKey를 적용하여 코드의 안정성을 높이는 것을 권장합니다. 이 변경을 Colors, Transparent 참조 해석에도 동일하게 적용해주세요.

Suggested change
// Grayscale 참조
if (ref.startsWith("Grayscale.")) {
const key = ref.replace("Grayscale.", "");
return `var(--${key})`;
}
// Grayscale 참조
if (ref.startsWith("Grayscale.")) {
const key = ref.replace("Grayscale.", "");
return `var(--${sanitizeKey(key)})`;
}

Comment on lines +113 to +125
// Colors 참조
if (ref.startsWith("Colors.Pink.")) {
const key = ref.replace("Colors.Pink.", "");
return `var(--${key})`;
}
if (ref.startsWith("Colors.Flame.")) {
const key = ref.replace("Colors.Flame.", "");
return `var(--${key})`;
}
if (ref.startsWith("Colors.Orange.")) {
const key = ref.replace("Colors.Orange.", "");
return `var(--${key})`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

resolveValue 함수 중복 코드

resolveValue 함수 내에 Colors.Pink, Colors.Flame, Colors.Orange 등 각 색상 그룹에 대한 참조를 처리하는 로직이 중복되어 있습니다.

  if (ref.startsWith("Colors.Pink.")) {
    const key = ref.replace("Colors.Pink.", "");
    return `var(--${sanitizeKey(key)})`;
  }
  if (ref.startsWith("Colors.Flame.")) {
    // ...
  }

이러한 구조는 새로운 색상 그룹이 추가될 때마다 코드를 수정해야 하므로 유지보수성을 저해합니다. 정규식이나 split을 사용하여 이 로직을 일반화하면 코드를 더 간결하고 확장성 있게 만들 수 있습니다.

@dasosann
Copy link
Contributor Author

/describe

@qodo-code-review
Copy link

PR Description updated to latest commit (354fd18)

@dasosann dasosann closed this Jan 26, 2026
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.

2 participants