Communitygithub.com

coastdigitalgroup/coastai-skills

뷰포트 크기에 따라 부드럽게 조정되는 타이포그래피 스케일을 CSS clamp()를 사용하여 설계하고 구현합니다. 반응형 타이포그래피, 디자인 시스템 또는 유동적인 레이아웃을 요청받을 때 이 스킬을 사용하세요.

coastai-skills란 무엇인가요?

이 스킬은 CSS `clamp()` 함수를 활용하여 뷰포트 크기에 따라 부드럽게 확장 및 축소되는 유동적인 타이포그래피 시스템을 구축하는 방법을 제공합니다. 전통적인 미디어 쿼리 방식의 고정된 중단점에서 크기가 갑자기 변경되는 문제를 해결하며, 시각적 일관성을 높이고 유지보수 부담을 줄여줍니다. 이 스킬은 뷰포트 범위, 기본 글꼴 크기, 배율 비율을 입력받아 CSS 사용자 정의 속성과 유틸리티 클래스를 생성합니다. 접근성을 최우선으로 하여 `rem` 단위와 `clamp()`를 결합하여 사용자의 브라우저 확대 및 글꼴 크기 설정을 존중하며, WCAG 1.4.4 및 1.4.10을 준수합니다. Cursor, Claude Code 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/fluid-typography-system

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

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

문서

유동적인 타이포그래피 시스템

목적

유동적인 타이포그래피 시스템 스킬은 사용자의 뷰포트 크기에 따라 부드럽게 적응하는 타이포그래피 스케일을 생성할 수 있게 해줍니다. 특정 중단점에서 고정된 크기 사이를 점프하는 대신, CSS clamp() 함수를 사용하여 정의된 최소값과 최대값 사이에서 선형적으로 확장됩니다. 이는 시각적 조화와 가독성을 향상시키고 많은 미디어 쿼리를 관리하는 유지보수 오버헤드를 줄여줍니다.

사용 사례

  • 처음부터 반응형 디자인 시스템 구축.
  • 기존 웹사이트의 타이포그래피를 개선하여 다양한 기기 간 일관성 향상.
  • 텍스트가 모든 화면 크기에서 가용 공간을 완벽하게 채워야 하는 레이아웃 생성.
  • 여러 @media 규칙을 하나의 유동적인 변수 세트로 대체하여 CSS 단순화.

사용하지 말아야 할 경우

  • 레거시 브라우저 지원: 프로젝트가 clamp()를 이해하지 못하는 브라우저(예: Internet Explorer)를 지원해야 하는 경우.
  • 고정 너비 디자인: 레이아웃이 엄격하게 고정되어 있고 반응형이 아닌 경우.
  • 극한의 정밀도: 특정 브랜드 가이드라인이 선형적인 스케일과 일치하지 않는 모든 해상도에서 정확한 픽셀 크기를 요구하는 경우.

입력

유동적인 타이포그래피 시스템을 생성하려면 다음이 필요합니다.

  1. 뷰포트 범위:
    • 최소 너비: 스케일링이 시작되는 화면 너비 (예: 320px).
    • 최대 너비: 스케일링이 멈추는 화면 너비 (예: 1200px).
  2. 기본 글꼴 크기:
    • 최소 크기: 최소 너비에서의 본문 글꼴 크기 (예: 16px).
    • 최대 크기: 최대 너비에서의 본문 글꼴 크기 (예: 20px).
  3. 배율 비율:
    • 제목의 크기를 결정하는 승수 (예: 1.250은 "Major Third", 1.333은 "Perfect Fourth").

출력

  1. CSS 사용자 정의 속성: 유동적인 스케일을 정의하는 CSS 변수 블록.
  2. 타이포그래피 유틸리티 클래스: (선택 사항) 스케일을 쉽게 적용할 수 있는 CSS 클래스.
  3. 계층 구조 문서: Body에서 H1까지의 크기 매핑을 명확히 보여주는 문서.

워크플로우

1. 스케일 매개변수 정의

최소/최대 뷰포트와 기본 크기를 결정합니다. 예시: 320px ~ 1280px, 16px ~ 18px 기본.

2. 타이포그래피 스케일 선택

브랜드의 성격에 맞는 비율을 선택합니다.

  • 1.067 (Minor Second): 미묘한 차이, 밀집된 데이터에 적합.
  • 1.200 (Minor Third): 표준적이고 균형 잡힘.
  • 1.414 (Augmented Fourth): 대비가 강하고 굵은 제목.

3. 계층 레벨 계산

각 레벨(H6 ~ H1)에 대해 기본 크기에 비율을 곱합니다. 공식: 크기_레벨 = 기본 * (비율 ^ 레벨)

4. 유동적인 공식 생성

계산된 최소/최대 픽셀 값을 clamp() 함수로 변환합니다. clamp(최소, 선호, 최대)

선호 값 계산: 기울기 = (최대_크기 - 최소_크기) / (최대_뷰포트 - 최소_뷰포트) y_절편 = 최소_크기 - 기울기 * 최소_뷰포트 선호 = (y_절편) + (기울기 * 100vw)

5. 구현

생성된 CSS 변수를 디자인에 적용합니다.

결정 규칙

  • 접근성 우선: 본문 텍스트의 최소 크기는 1rem(16px) 미만이어서는 안 됩니다.
  • 사용자 선호도 존중: 최종 출력에는 항상 rem 단위를 사용하여 사용자의 브라우저 글꼴 크기 설정이 존중되도록 합니다. rem 기반 최소/최대 클램핑 없이 vw 단독 크기 조정을 절대 사용하지 마십시오. 순수한 뷰포트 단위는 사용자의 브라우저 확대/축소 및 글꼴 크기 설정을 무시하여 WCAG 1.4.4 (텍스트 크기 조정)를 위반할 수 있습니다.
  • 스케일 강도: 모바일 중심 사이트에는 더 작은 비율을 사용하여 작은 화면에서 제목이 너무 커지는 것을 방지합니다.

제약 조건

  • 반응성: 타이포그래피는 컨테이너의 경계를 넘어 오버플로우를 일으키지 않아야 합니다.
  • 가독성: 줄 길이는 이상적으로 45~75자 사이를 유지해야 합니다. 텍스트 크기에 따라 컨테이너 너비를 적절히 조정합니다.
  • 계층 구조: H1은 시각적으로 H2보다 항상 뚜렷하고 커야 하며, H2는 H3보다 커야 하는 식입니다.

일반적인 실패 패턴

  • 잘못된 수학: 화면이 커질수록 텍스트가 작아지는 결과.
  • 단위 불일치: px와 rem을 브라우저 확대/축소를 망가뜨리는 방식으로 혼용.
  • 과도한 스케일링: 4K 모니터에서 제목이 너무 커져 뷰포트 전체를 지배.
  • 접근성 부족: 사용자가 확대하거나 OS/브라우저 기본 글꼴 크기를 늘릴 때 유동적인 스케일이 어떻게 동작하는지 테스트하지 않는 경우 (WCAG 1.4.4 텍스트 크기 조정, WCAG 1.4.10 리플로우).

검증 기준

  • 브라우저 창 크기를 조정할 때 타이포그래피가 부드럽게 확장/축소됩니다.
  • 눈에 띄는 "점프"나 갑작스러운 크기 변화가 없습니다.
  • 320px 너비에서 모든 텍스트를 읽을 수 있습니다.
  • 제목이 본문 텍스트에 비해 명확한 계층 구조를 유지합니다.
  • 시스템이 기본에는 rem 단위를, 유동적인 동작에는 clamp()를 사용합니다.
  • 400% 브라우저 확대 시 텍스트가 내용이나 기능 손실 없이 리플로우되며 (WCAG 1.4.10 리플로우) 사용자의 글꼴 크기 설정을 존중합니다 (WCAG 1.4.4).

Individual skills in this repo

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

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

관련 스킬