Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dylantarre avatar

Type Scale

  • 10 installs
  • 37 repo stars
  • Updated December 30, 2025
  • dylantarre/design-system-skills

Generates typography scales using modular ratios with auto-calculated line heights for heading hierarchy, output as CSS, Tailwind, or JSON.

About

This skill generates typography scales using modular ratios with auto-calculated line heights. A developer uses it to set up font-size tokens and heading hierarchy.

  • Modular-ratio type scale
  • Auto-calculated line heights

Type Scale by the numbers

  • 10 all-time installs (skills.sh)
  • Ranked #1,450 of 1,880 Design & UI/UX skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dylantarre/design-system-skills --skill type-scale

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs10
repo stars37
Last updatedDecember 30, 2025
Repositorydylantarre/design-system-skills

What it does

Generates typography scales using modular ratios with auto-calculated line heights for heading hierarchy, output as CSS, Tailwind, or JSON.

Files

SKILL.mdMarkdownGitHub ↗

Type Scale Generator

Overview

Generate harmonious typography scales using musical interval ratios. Automatically calculates appropriate line heights based on font size for optimal readability.

When to Use

  • Setting up typography for a new project
  • Creating heading hierarchy (h1-h6)
  • Standardizing font sizes across components
  • Building a responsive type system

Quick Reference: Musical Ratios

NameRatioCharacter
Minor Second1.067Subtle, tight
Major Second1.125Conservative
Minor Third1.2Versatile (recommended)
Major Third1.25Balanced
Perfect Fourth1.333Bold contrast
Augmented Fourth1.414Dramatic
Perfect Fifth1.5High contrast
Golden Ratio1.618Classical, striking

The Process

1. Get base size: Default 16px (browser default, good baseline) 2. Choose ratio: Recommend Minor Third (1.2) for most projects 3. Steps up: How many sizes above base (6-8 typical for headings) 4. Steps down: How many sizes below base (2-3 for small/caption text) 5. Ask unit: px, rem, or em? 6. Ask format: CSS, Tailwind, or JSON? 7. Generate: Create scale with auto line heights

Auto Line Height

Larger fonts need tighter line height for readability:

Font SizeLine HeightReasoning
14px or less1.7Small text needs room
15-18px1.6Body text range
19-24px1.5Large body/small headings
25-32px1.4Subheadings
33-48px1.3Headings
49px+1.2Display text

Output Formats

CSS Custom Properties:

:root {
  /* Font Sizes */
  --text-xs: 13.33px;
  --text-sm: 14.22px;
  --text-base: 16px;
  --text-lg: 19.2px;
  --text-xl: 23.04px;
  --text-2xl: 27.65px;

  /* Line Heights */
  --leading-xs: 1.70;
  --leading-sm: 1.70;
  --leading-base: 1.60;
  --leading-lg: 1.50;
  --leading-xl: 1.50;
  --leading-2xl: 1.40;
}

Tailwind Config:

module.exports = {
  theme: {
    fontSize: {
      'xs': ['13.33px', { lineHeight: '1.70' }],
      'sm': ['14.22px', { lineHeight: '1.70' }],
      'base': ['16px', { lineHeight: '1.60' }],
      'lg': ['19.2px', { lineHeight: '1.50' }],
      'xl': ['23.04px', { lineHeight: '1.50' }],
      '2xl': ['27.65px', { lineHeight: '1.40' }],
    }
  }
}

JSON Tokens:

{
  "typography": {
    "xs": { "fontSize": "13.33px", "lineHeight": "1.70" },
    "sm": { "fontSize": "14.22px", "lineHeight": "1.70" },
    "base": { "fontSize": "16px", "lineHeight": "1.60" },
    "lg": { "fontSize": "19.2px", "lineHeight": "1.50" }
  }
}

Naming Convention

PositionName
3 below basexxs
2 below basexs
1 below basesm
Basebase
1 above baselg
2 above basexl
3+ above base2xl, 3xl, 4xl...

Common Configurations

Compact UI (dashboards, data-dense):

  • Ratio: 1.125 (Major Second)
  • Base: 14px
  • Steps: 2 down, 5 up

Content Site (blogs, marketing):

  • Ratio: 1.25 (Major Third)
  • Base: 18px
  • Steps: 2 down, 6 up

Editorial (magazines, long-form):

  • Ratio: 1.333 (Perfect Fourth)
  • Base: 20px
  • Steps: 2 down, 8 up

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.