Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"css.lint.unknownAtRules": "ignore"
}
3 changes: 2 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'tailwindcss';
@import "tailwindcss";
@import "tw-animate-css";
@import "./tokens.css";

@custom-variant dark (&:is(.dark *));

Expand Down
112 changes: 55 additions & 57 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,61 @@
import Image from "next/image";

export default function Home() {
return (
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between bg-white px-16 py-32 sm:items-start dark:bg-black">
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={100}
height={20}
priority
/>
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
<h1 className="max-w-xs text-3xl leading-10 font-semibold tracking-tight text-black dark:text-zinc-50">
To get started, edit the page.tsx file.
<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번 줄) 등 다른 곳에서도 동일한 문제가 발견되니 함께 검토해주세요.

<h1 className="text-24-700 text-brand-black border-b pb-4">
🎨 Design Token Test
</h1>
<p className="max-w-md text-lg leading-8 font-[700] text-zinc-600 dark:text-zinc-400">
Looking for a starting point or more instructions? Head over to{" "}
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Templates
</a>{" "}
or the{" "}
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Learning
</a>{" "}
center.
</p>
</div>
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
<a
className="bg-foreground text-background flex h-12 w-full items-center justify-center gap-2 rounded-full px-5 transition-colors hover:bg-[#383838] md:w-[158px] dark:hover:bg-[#ccc]"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={16}
height={16}
/>
Deploy Now
</a>
<a
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] md:w-[158px] dark:border-white/[.145] dark:hover:bg-[#1a1a1a]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Documentation
</a>

{/* 1. Typography */}
<section className="space-y-4">
<h2 className="text-20-600">1. Typography</h2>
<div className="space-y-2 rounded bg-gray-50 p-4">
<p className="text-24-700">Display 24px (Bold 700)</p>
<p className="text-20-600">Title 20px (SemiBold 600)</p>
<p className="text-18-500">Body 18px (Medium 500)</p>
<p className="text-16-400">Body 16px (Regular 400)</p>
<p className="text-14-400 text-disabled">
Caption 14px (Disabled Color)
</p>
</div>
</section>

{/* 2. Colors & Backgrounds */}
<section className="space-y-4">
<h2 className="text-20-600">2. Colors & Backgrounds</h2>
<div className="grid grid-cols-2 gap-4">
<div className="bg-brand-secondary-pink flex h-20 items-center justify-center rounded-lg text-white">
Pink Secondary
</div>
<div className="bg-brand-primary-orange flex h-20 items-center justify-center rounded-lg text-white">
Orange Primary
</div>
<div className="bg-surface-base border-light flex h-20 items-center justify-center rounded-lg border">
Surface Base
</div>
<div className="bg-disabled text-disabled flex h-20 items-center justify-center rounded-lg">
Disabled Area
</div>
</div>
</section>

{/* 3. Buttons */}
<section className="space-y-4">
<h2 className="text-20-600">3. Buttons</h2>
<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>
Comment on lines +47 to +57
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)

</section>
</div>
</main>
</div>
Expand Down
Loading