Communitygithub.com

디자인 토큰

CSS 사용자 정의 속성으로 웹사이트의 시각적 시스템을 생성합니다. 색상 팔레트, 타이포그래피 스케일, 간격, 모서리 및 그림자를 포함하며 대비를 확인합니다. 누군가 색상 구성, 브랜드 색상 하나로 만든 팔레트, 글꼴 조합, 타입 스케일, "일관성 있게 보이게", 다크 모드, 기존 사이트의 리브랜딩, 또는 스타일이 없는 상태에서 빌드를 시작할 때 사용하세요.

디자인 토큰란 무엇인가요?

이 기술은 CSS 사용자 정의 속성(디자인 토큰)을 사용하여 웹사이트의 일관된 시각적 시스템을 생성하는 방법을 정의합니다. 브랜드 색상 하나 또는 분위기를 나타내는 단어, 밝거나 어두운 배경, 분위기(기업, 유쾌한, 편집형, 기술적)를 입력받으면, 색상 팔레트, 타이포그래피 스케일, 간격, 모서리 둥글기, 그림자 등을 포함한 완전한 토큰 세트를 생성합니다. 색상은 역할 기반으로 구성되어 리브랜딩 시 이름을 변경할 필요가 없으며, 모든 텍스트-배경 쌍은 WCAG 대비 기준(본문 7:1, 보조 텍스트 4.5:1)을 통과해야 합니다. webcraft CLI 도구나 MCP 도구를 사용하여 자동으로 초기 토큰을 생성하고 대비를 검증할 수 있으며, 다크 모드도 별도로 처리합니다. 이 기술은 Claude Code, Cursor, Codex 등의 AI 에이전트 플랫폼에서 사용할 수 있으며, 디자이너나 개발자가 빠르게 일관된 디자인 시스템을 구축하거나 기존 사이트를 리브랜딩할 때 유용합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/imperfec-t/webcraft/tree/HEAD/skills/design-tokens

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

디자인 토큰은(는) 무엇을 하나요?

명명된 값들의 작은 집합을 모든 곳에서 사용하면 사이트가 조립된 듯한 느낌이 아니라 디자인된 느낌을 줍니다. 구성 요소보다 먼저 토큰을 정의하세요. 나중에 브랜드를 변경하면 한 블록만 수정하면 됩니다.

무엇을 물어볼 것인가

브랜드 색상 하나(또는 분위기를 나타내는 단어), 밝거나 어두운 배경, 그리고 톤(기업, 유쾌한, 편집형, 기술적). 나머지는 모두 파생될 수 있습니다.

색상

색상 이름이 아닌 역할로 작업하세요. 그러면 리브랜딩 시 이름을 바꿀 필요가 없습니다.

토큰역할경험 법칙
--bg페이지 배경거의 흰색 또는 거의 검은색, 절대 순수한 #fff 또는 #000을 사용하지 마세요
--surface카드, 입력 필드명도에서 --bg와 2~4% 차이
--text본문 텍스트--bg와 최소 7:1
--muted보조 텍스트--bg와 최소 4.5:1
--border가는 선텍스트 색상 10~15%를 배경에 혼합
--accent버튼, 강조브랜드 색상
--accent-ink--bg 위의 링크 및 강조 텍스트브랜드 색상을 4.5:1을 통과할 때까지 어둡게(또는 어두운 배경에서는 밝게) 한 것
--on-accent강조 색상 위의 텍스트흰색 또는 어두운 색 중 4.5:1을 통과하는 쪽

지침:

  • 중립 색상은 강조 색상의 색조로 약간 물들입니다(2~6% 채도). 따뜻한 강조 색상 옆에 순수한 회색은 관련성이 없어 보입니다.
  • 강조 색상은 표면의 약 10%에 사용하세요. 모든 것이 강조되면 아무것도 강조되지 않습니다.
  • 두 번째 강조 색상은 거의 필요하지 않습니다. 성공 또는 판매와 같은 뚜렷한 의미가 있는 경우에만 추가하세요.
  • 다크 모드의 경우 반전시키지 마세요. 표면 명도를 높이(계층)에 따라 밝게 하고 강조 색상 채도를 약간 줄여서 빛나지 않도록 하세요.

webcraft CLI를 사용할 수 있다면 값을 수동으로 파생하는 대신 시작 세트를 생성하세요. 위의 모든 규칙을 적용하고, 각 쌍이 기준을 통과할 때까지 명도를 조정하며, 다크 테마를 별도로 빌드합니다:

webcraft tokens "#e4572e" --tone editorial -o tokens.css      # 또한: --base dark, --radius pill
webcraft tokens "#e4572e" --format theme-json                 # 동일한 값을 가진 WordPress theme.json

MCP 클라이언트 내에서는 동일한 작업이 generate_tokens 도구입니다. 출력물을 초안으로 취급하세요: 눈으로 조정한 후 다시 확인하세요.

마무리하기 전에 모든 텍스트-배경 쌍을 확인하세요:

webcraft contrast "#1b1b1f" "#f6f4ef"
webcraft contrast --tokens tokens.css
python scripts/contrast.py --tokens tokens.css   # 설치 불필요 대체 방법, 16진수 값만 가능

첫 번째 형식은 한 쌍의 비율과 WCAG 수준을 출력합니다. 두 번째는 CSS 파일을 읽고 모든 테마 블록(:root, [data-theme], prefers-color-scheme)에서 표준 역할 쌍을 확인하며, var()를 해석하고 #rgb(), hsl(), oklch(), color-mix()를 읽습니다. 실패하는 쌍은 새 사이트에서 가장 흔한 접근성 결함이며, 좋은 모니터에서 시력이 좋은 사람에게는 보이지 않으므로, 이것은 판단이 아닌 스크립트로 처리하는 이유입니다.

타이포그래피

  • 최대 두 개의 패밀리: 하나는 제목용, 하나는 본문용. 종종 한 패밀리를 두 가지 굵기로 사용하는 것이 더 좋습니다.
  • 구조의 대비로 페어링하세요(세리프 디스플레이와 산세리프 본문, 또는 좁은 디스플레이와 일반 본문). 비슷한 두 산세리프는 피하세요.
  • 본문 크기 1618px, 줄 높이 1.51.7, 줄 길이 60~75자.
  • 디스플레이 타입: 줄 높이 0.95~1.1, 크기가 커질수록 자간을 좁게.
  • clamp()를 사용한 유동적 스케일로 중단점 간 점프가 없도록:
:root {
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  --step-2:  clamp(1.6rem, 1.3rem + 1.3vw, 2.4rem);
  --step-3:  clamp(2rem, 1.5rem + 2.6vw, 3.6rem);
  --step-4:  clamp(2.5rem, 1.6rem + 4.6vw, 5.5rem);
  --step-5:  clamp(3rem, 1.5rem + 7vw, 7.5rem);
}
  • font-display: swap로 폰트를 로드하고, 초기 화면에 사용되는 한두 개 파일을 미리 로드하며, 셀프 호스팅 시 서브세팅하세요.

간격, 모서리, 그림자

:root {
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem;  --space-8: 2rem;   --space-12: 3rem;   --space-16: 4rem;
  --section: clamp(4rem, 3rem + 6vw, 9rem);   /* 섹션 간 세로 패딩 */
  --gutter:  clamp(1rem, 0.5rem + 3vw, 3rem); /* 페이지 측면 패딩 */
  --container: 76rem;

  --radius-sm: 8px; --radius: 16px; --radius-lg: 28px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
}
  • 하나의 모서리 성격(날카로운, 부드러운, 또는 알약)을 선택하고 유지하세요. 혼합된 모서리 반경은 가장 빠르게 일관성을 해치는 방법입니다.
  • 섹션 간 간격은 섹션 내부 간격보다 분명히 커야 합니다. 그 간격이 눈에 섹션이 끝나는 위치를 알려줍니다.

출력

:root 블록, 선택적 [data-theme="dark"] 블록, 그리고 각 토큰이 어디에 사용되는지에 대한 짧은 표가 포함된 하나의 tokens.css를 제공하세요. 그런 다음 본문 텍스트, 보조 텍스트 및 버튼 텍스트에 대한 대비 결과를 명시하세요.

기존 사이트 리브랜딩

먼저 하드코딩된 기존 값을 역할에 매핑하고(CSS에서 16진수 코드를 검색하여 발생 횟수 계산), 이를 토큰으로 대체하고, 시각적으로 변경된 사항이 없는지 확인한 후, 토큰 값을 교체하세요. 두 작업을 동시에 수행하면 회귀를 추적할 수 없게 됩니다.

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

hero-section

Design and build the hero (first screen) of a website, including headline layout, media treatment, CTA, proof badge, marquee and entrance animation. Use this whenever someone asks for a hero section, a landing page header, "the top of my homepage", a cinematic or animated intro, a video background, a text marquee, or says their first screen looks plain or generic.

homepage-blueprint

Plan the section structure and content slots of a homepage for an agency, freelancer, studio or service business before any design or code. Use this whenever someone asks "what sections should my homepage have", "plan my website", "structure a landing page for my business", wants a wireframe or sitemap for a service site, or starts building a homepage without a clear outline.

launch-qa

Run a pre-launch quality check on a website covering performance, accessibility, SEO basics, forms, cross-device behavior and content, and report findings ranked by severity with fixes. Use this whenever someone says a site is "ready to launch", "going live", asks "can you check my site", wants a QA pass, a website audit, a Lighthouse-style review, or wants to know why a page is slow or scoring badly.

responsive-layout

Build page layouts that work from phones to wide desktops using CSS grid, flexbox, container queries and fluid sizing, including card grids, bento grids, split sections, sticky sidebars and navigation that collapses. Use this whenever someone says their site "breaks on mobile", asks for a responsive grid, a bento layout, a mobile menu, fixing horizontal scroll or overflow, or is laying out any multi-column section.

scroll-motion

Add scroll-driven and entrance animation to a website with GSAP, ScrollTrigger and Lenis, including reveals, parallax, pinned sections, horizontal scroll, line drawing, counters and preloaders. Use this whenever someone wants a site to "feel premium", asks for smooth scrolling, scroll animations, parallax, text reveals, a pinned or sticky scroll section, an animated preloader, or names GSAP, ScrollTrigger, Lenis, Locomotive or AOS.

site-teardown

Analyze a live website and turn it into a section-by-section build brief that another person or AI can rebuild from, with brand name, colors, fonts and images swapped for placeholders. Use this whenever someone shares a URL and says "analyze this site", "make something like this", "give me a prompt to build this", "recreate this effect", "clone the layout with my branding", or asks how a page's animation or structure works, even if they never say "teardown".

website-workflow

Plan and sequence a whole website build, from structure through design, code, WordPress and launch, by routing each stage to the right webcraft skill. Use this when someone asks to "build me a website", "design my site from scratch", "redo our homepage", wants an end-to-end plan for a marketing, agency, studio or service site, or the request spans more than one of structure, look, layout, motion, CMS and QA.

wordpress-theme-build

Turn a static HTML/CSS/JS design into a custom WordPress theme that the client can edit, covering theme structure, theme.json, enqueueing scripts, block patterns, custom post types and editable content. Use this whenever someone wants to convert a design or static site to WordPress, build a custom or block theme, make sections editable in Gutenberg, add GSAP or other scripts to a theme properly, or asks why their theme edits are lost or their content is hard-coded.

관련 스킬