skills/typography/SKILL.md
Typography principles for print and screen. Use when selecting fonts, setting type, designing text layouts, or creating web typography.
npx skillsauth add igbuend/grimbard typographyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Principles for effective typography across print and screen.
| Type | Examples | Best For | |------|----------|----------| | Old Style | Garamond, Caslon | Books, long reading | | Transitional | Baskerville, Times | Academic, newspapers | | Modern | Bodoni, Didot | Luxury, headlines | | Slab | Rockwell, Roboto Slab | Web, signage |
| Type | Examples | Best For | |------|----------|----------| | Grotesque | Helvetica, Arial | Corporate, UI | | Neo-Grotesque | Inter, Roboto | Modern interfaces | | Geometric | Futura, Montserrat | Headlines, logos | | Humanist | Gill Sans, Open Sans | Reading, accessibility |
Measure (line length): 45-75 characters optimal
Leading: 1.4-1.6× for body, 1.1-1.3× for headlines
Ligatures: Use fi, fl, ff in body text
Small caps: For acronyms (NASA, WHO)
Oldstyle figures: Blend with lowercase
Minimum sizes:
Line height: 1.5-1.7 for body (more than print)
Contrast: 4.5:1 minimum (WCAG)
Dark mode: Avoid pure white on black
@font-face {
font-family: 'MyFont';
src: url('font.woff2') format('woff2');
font-display: swap; /* Prevents FOIT */
}
<link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>
| Scale | Ratio | Use Case | |-------|-------|----------| | Major Second | 1.125 | Simple websites | | Minor Third | 1.200 | Blogs | | Major Third | 1.250 | Marketing sites | | Perfect Fourth | 1.333 | Editorial |
html {
font-size: clamp(1rem, 0.5rem + 1vw, 1.5rem);
}
Levels: h1 → h2 → h3 → body → caption
Size contrast: 1.5× minimum between levels
Techniques: Size, weight, color, spacing
WCAG Requirements:
Best fonts for accessibility:
❌ Too many fonts (limit to 2-3)
❌ Insufficient contrast
❌ Line lengths >75 or <45 chars
❌ Ignoring dark mode
❌ Using display fonts for body
❌ Justified text on web (creates rivers)
Web body: 16px, 1.5-1.7 line-height, 60-75 chars
Print body: 10-12pt, 1.4-1.6× leading
Headlines: 1.5-3× body, use modular scale
Pairing: Serif + sans-serif, match x-heights
Single file with multiple weights/widths:
h1 {
font-variation-settings: 'wght' 700, 'wdth' 80;
}
Common axes: wght (weight), wdth (width), slnt (slant), opsz (optical size)
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.