agentskills.codes
TW

tw-typography-fluid

Fluid typography: clamp(), viewport-relative sizing. Use when: creating text that scales smoothly between breakpoints, responsive headings, hero text.

Install

mkdir -p .claude/skills/tw-typography-fluid && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15044" && unzip -o skill.zip -d .claude/skills/tw-typography-fluid && rm skill.zip

Installs to .claude/skills/tw-typography-fluid

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Fluid typography: clamp(), viewport-relative sizing. Use when: creating text that scales smoothly between breakpoints, responsive headings, hero text.
150 chars✓ has a “when” trigger

About this skill

Fluid Typography

When to Use

  • Hero headings that scale smoothly with viewport
  • Avoiding abrupt text size jumps between breakpoints
  • Large display text that adapts to any screen size

Rules

  1. Use clamp() for fluid sizingclamp(min, preferred, max)
  2. Preferred value uses vw units — scales with viewport width
  3. Always set min and max bounds — prevents unreadable extremes
  4. Body text stays fixed — fluid sizing for headings/display text only
  5. Test at 320px and 2560px — verify both extremes

Patterns

Fluid Hero Heading

<h1 class="font-bold tracking-tight text-[var(--color-text-primary)]"
    style="font-size: clamp(1.875rem, 4vw + 1rem, 3.75rem)">
  GSM Firmware Distribution
</h1>

Fluid Scale Reference

Elementclamp() Value320px768px1440px
Hero H1clamp(1.875rem, 4vw + 1rem, 3.75rem)30px~42px60px
Page H1clamp(1.5rem, 2.5vw + 0.75rem, 2.25rem)24px~30px36px
Section H2clamp(1.25rem, 1.5vw + 0.75rem, 1.75rem)20px~24px28px
Large bodyclamp(1rem, 0.5vw + 0.875rem, 1.125rem)16px~17px18px

Using CSS Custom Properties

/* static/css/src/_typography.scss */
:root {
  --text-fluid-hero: clamp(1.875rem, 4vw + 1rem, 3.75rem);
  --text-fluid-h1: clamp(1.5rem, 2.5vw + 0.75rem, 2.25rem);
  --text-fluid-h2: clamp(1.25rem, 1.5vw + 0.75rem, 1.75rem);
}
<h1 class="font-bold text-[var(--text-fluid-hero)]
           text-[var(--color-text-primary)]">
  Fluid Hero Title
</h1>

With Tailwind Arbitrary Values

<!-- Fluid without inline style -->
<h1 class="text-[clamp(1.5rem,3vw+0.5rem,3rem)]
           font-bold text-[var(--color-text-primary)]">
  Scales Smoothly
</h1>

Anti-Patterns

PatternProblemFix
font-size: 5vw without clampToo small on mobile, too large on 4KWrap in clamp()
Fluid body textUnnecessary, confusingKeep body at text-base (1rem)
clamp(0.5rem, ...)Minimum too small to readMin at least 1rem for body, 1.25rem for headings
Only using breakpoint classes for headingsAbrupt size jumpsUse clamp() for smooth scaling

Red Flags

  • Viewport-relative units (vw, vh) without clamp() bounds
  • Fluid sizing on body paragraph text (keep fixed)
  • Min value below readable threshold

Quality Gate

& .\.venv\Scripts\python.exe -m ruff check . --fix
& .\.venv\Scripts\python.exe -m ruff format .
& .\.venv\Scripts\python.exe manage.py check --settings=app.settings_dev

References

  • static/css/src/_variables.scss — typography variables
  • templates/base/base.html — viewport meta tag

Search skills

Search the agent skills registry