From harness-claude
Guides text readability optimization: line length (45-75 chars with font-specific max-widths), line-height by context/size, alignment, hyphenation for docs, blogs, articles.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Optimizing for reading — line length (measure), line height (leading), paragraph spacing, text alignment, hyphenation, and reading patterns (F-pattern, Z-pattern)
Guides web typography: font selection, pairing, scaling, spacing, responsive type, variable fonts, loading optimization, accessibility, and readability.
Enforces typography rules—curly quotes, dashes, spacing, hierarchy—in HTML/CSS/React/JSX UI code. Auto-applies silently on generation; audits and fixes existing code.
Establishes typographic hierarchy using size, weight, color, spacing, case, and position to guide reading order. For page layouts, component libraries, flat design audits, and dashboards.
Share bugs, ideas, or general feedback.
Optimizing for reading — line length (measure), line height (leading), paragraph spacing, text alignment, hyphenation, and reading patterns (F-pattern, Z-pattern)
max-width on text containers to control line lengthline-height values for body text, headings, and captionsSet line length (measure) to 45-75 characters per line. This is the single most impactful readability setting. The research is unambiguous: lines shorter than 45 characters cause excessive line breaks and choppy reading; lines longer than 75 characters cause the eye to lose its place when returning to the left margin.
Concrete values for common body sizes:
| Font Size | Font | Ideal Max-Width | ~Characters |
|---|---|---|---|
| 16px | Inter | 640-680px | 65-70 |
| 16px | Georgia | 600-640px | 62-67 |
| 18px | system-ui | 700-740px | 63-68 |
| 21px | Georgia | 780-820px | 60-65 |
Decision procedure: Set max-width on your text container. Paste a paragraph of real content. Count characters in the longest line. Adjust until you hit 60-70 characters. The exact pixel value depends on font, size, and letter-spacing — there is no universal pixel number.
Two-column exception: When text is set in narrow columns (sidebars, cards, multi-column layouts), 35-45 characters per line is acceptable because the vertical distance between lines is shorter, making the return sweep easier.
Set line-height (leading) based on context. Leading is the vertical distance between baselines. Too tight and lines collide visually; too loose and the text disintegrates into separate strips.
| Context | Line-Height | Rationale |
|---|---|---|
| Body text (16-18px) | 1.5-1.65 | Optimal for sustained reading |
| Large body (20-24px) | 1.4-1.5 | Larger text needs proportionally less leading |
| Headings (24-48px) | 1.1-1.25 | Tight leading keeps multi-line headings cohesive |
| Display text (48px+) | 1.0-1.1 | Very large text looks disconnected with normal leading |
| Captions (12-14px) | 1.4-1.5 | Small text needs generous leading for legibility |
| Code blocks | 1.5-1.7 | Programmers scan vertically; generous leading aids line identification |
The inverse relationship: as font size increases, optimal line-height ratio decreases. Stripe demonstrates this: body at 16px uses line-height 1.40, but display headlines at 56px use line-height 1.03. The absolute leading increases (22.4px vs 57.7px) but the ratio tightens dramatically.
Set paragraph spacing to 0.5-1.0em between paragraphs. Use margin-bottom on paragraphs, not double line breaks. The spacing should be large enough to signal "new paragraph" but not so large that the text feels disconnected.
margin-bottom: 1em (one blank line's worth) — used by most systemsmargin-bottom: 0.5em — for data-dense interfaces or when vertical space is premiummargin-bottom: 1.5em — for editorial/literary content with wide line spacingDefault to left-aligned text for body content in LTR languages. Alignment choices:
hyphens: auto is set AND the language has good hyphenation dictionaries (English, German, French — yes; Japanese, Chinese — not applicable). Even then, prefer left-aligned.Understand reading patterns to structure content. Eye-tracking research (Nielsen Norman Group) identified two primary scanning patterns:
F-Pattern (content-heavy pages):
Z-Pattern (sparse layouts, landing pages):
Optimize the relationship between font size, line-height, and measure. These three properties are interdependent — changing one requires reconsidering the others:
Stripe Documentation
Apple Developer Documentation
Medium / Reading-Optimized Platforms
Material Design 3
Practical table for common configurations:
| Scenario | Font Size | Line-Height | Max-Width | Chars/Line |
|---|---|---|---|---|
| Documentation | 16px | 1.6 | 680px | 68 |
| Blog/editorial | 18px | 1.7 | 720px | 62 |
| Literary reading | 21px | 1.6 | 680px | 52 |
| Dashboard text | 14px | 1.5 | 480px | 55 |
| Card description | 14px | 1.45 | 320px | 38 |
| Code block | 14px | 1.6 | 880px | 100 |
Code blocks are the exception to the 75-character rule — developers expect wide lines and horizontal scroll, and the monospace font provides character-level position tracking that proportional fonts cannot.
Justified text is the default in print because page layout engines (InDesign, TeX) have sophisticated paragraph-level justification algorithms. Web browsers do not — they justify line by line, producing inferior results.
If you must use justified text on the web:
.justified-text {
text-align: justify;
hyphens: auto;
-webkit-hyphens: auto;
word-break: break-word; /* prevent overflow on long words */
overflow-wrap: break-word;
max-width: 680px; /* justified text requires controlled measure */
}
Even with these settings, justified web text will have visible rivers in narrow columns. If the container is narrower than 500px, never justify.
Full-width body text. Setting body text at width: 100% on a 1920px monitor produces lines of 160+ characters. The eye cannot track back to the correct next line after such a long horizontal sweep. This is the most common readability failure on the web. Fix: max-width: 65ch or a pixel equivalent based on your font.
Cramped leading. Line-height of 1.0-1.2 for body text (16px font, 16-19px line-height) causes ascenders and descenders of adjacent lines to collide visually. The text feels dense, claustrophobic, and tiring. Common cause: inheriting line-height: 1.2 from a CSS reset that was designed for headings, not body text. Fix: set body line-height explicitly to 1.5-1.65.
Justified text without hyphenation. Justified text distributes extra space between words to fill the line. Without hyphenation, long words force enormous gaps. On narrow columns (300-400px), individual lines can have gaps wider than the words themselves, creating "rivers" of white space that flow vertically through the paragraph. Fix: either add hyphens: auto or switch to text-align: left.
Centered body paragraphs. Centering more than 3 lines of text destroys the fixed left edge that the eye uses to locate the start of each new line. Reading speed drops by 10-20% (per Nielsen Norman Group research). Fix: center only headings, short taglines, and CTAs. Left-align all body paragraphs.
Uniform line-height across all sizes. Setting line-height: 1.5 globally means a 48px heading gets 72px of leading (excessive, text floats apart) while 12px captions get 18px (possibly too tight). Fix: define line-height per text role, with the ratio decreasing as font size increases.
Fixing a Documentation Site Before: 14px body, line-height 1.3, full-width (1200px container), justified alignment. Users reported "eye strain" and "losing my place." After: 16px body, line-height 1.6, max-width 680px centered in the layout, left-aligned. Bounce rate decreased 15%, average time on page increased 25%. The changes were purely typographic — no content, layout, or color changes.
Optimizing a Reading App A Kindle-style web reader tested 3 configurations with 500 users:
This is a knowledge skill. When activated, it provides readability optimization expertise for text layout decisions. Use these principles when setting max-width, line-height, text-align, margin-bottom, and hyphens properties. Cross-reference with design-responsive-type for viewport-adaptive adjustments and design-content-density for information-rich interfaces.