Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Typographic Rag Tuner

ASecurity

Control how text wraps — `text-wrap: balance` on headings so no single word dangles on the last line, `text-wrap: pretty` on paragraphs for a clean ragged edge, and nowrap/hyphenation/overflow rules for names, dates, units, and URLs. Use this whenever writing CSS for any text-bearing element (headings, hero copy, paragraphs, cards, captions, quotes), setting up base typography, or when the user says "orphan", "widow", "dangling word", "the heading wraps badly", "ragged edge", "uneven lines", ...

2 stars
0 votes
0 copies
0 views
Added 9/19/2026
designgo

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add fernandokylas/editorial-web-craft --skill typographic-rag-tuner --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typographic Rag Tuner?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Typographic Rag Tuner
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fernandokylas-typographic-rag-tuner/badge)](https://www.skillsdirectory.com/skills/fernandokylas-typographic-rag-tuner)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: typographic-rag-tuner
description: >-
  Control how text wraps — `text-wrap: balance` on headings so no single word dangles on the last
  line, `text-wrap: pretty` on paragraphs for a clean ragged edge, and nowrap/hyphenation/overflow
  rules for names, dates, units, and URLs. Use this whenever writing CSS for any text-bearing element
  (headings, hero copy, paragraphs, cards, captions, quotes), setting up base typography, or when the
  user says "orphan", "widow", "dangling word", "the heading wraps badly", "ragged edge", "uneven
  lines", "one word on its own line", "make the typography feel polished", or asks for
  editorial/premium copy layout.
---

# Typographic Rag Tuner

A headline that wraps to two full lines and then one lonely "growth." on a third reads as broken, even though every word is right. A paragraph whose last line is a single "it." looks unfinished. A block whose right edge zig-zags between 30 and 62 characters has a jagged silhouette that tires the eye before it's read anything. Print typographers fix these by hand; the browser now has two algorithms that do most of it, if they're switched on. Treat every text block as a shape, not a stream, and set the wrapping rules that keep the shape clean.

## The two rules

**Headings balance.** `text-wrap: balance` tells the engine to distribute the words so lines are as even as possible — a two-line heading becomes 50/50 instead of 90/10, and the dangling last word disappears. It belongs on anything short and prominent: H1–H4, pull quotes, card titles, hero statements, blurbs under five lines. It stops working past ~6 lines and costs layout time, so it must not go on paragraphs.

**Paragraphs go pretty.** `text-wrap: pretty` looks ahead a few lines and adjusts earlier breaks to avoid an orphan on the final line, and tidies the rag. It belongs on `p`, `li`, `blockquote`, `figcaption`, `dd` — anything multi-line and read continuously. It's cheap enough for whole documents.

```css
@layer base {
  h1, h2, h3, h4, .editorial-title { text-wrap: balance; }
  h1, h2 { letter-spacing: -0.02em; }   /* display sizes set tighter; loose tracking exaggerates gaps */
  h3, h4 { letter-spacing: -0.01em; }   /* sub-heads: a touch, not the display tightness */
  p, li, blockquote, figcaption, dd, .copy-narrative {
    text-wrap: pretty;
    max-width: 62ch;             /* the measure the algorithm needs to find good breaks */
  }
}
```

Both are progressive enhancements — an older browser just wraps normally — so there's no reason to withhold them. Put them in the base layer once, not per component.

## What the algorithms can't do

They choose break *positions*; they don't know that some things must not break at all. Handle those explicitly:

- **Things that belong together** — `Q3 2026`, `Dr. Okafor`, `12 %`, `iPhone 17 Pro`, `4 pm`: `<span class="nowrap">` (`white-space: nowrap`) or a non-breaking space. Use a narrow no-break space (`&#8239;`) before units and `%`.
- **Things that must break somewhere** — URLs, email addresses, hashes, long identifiers: `overflow-wrap: anywhere` on *those elements only*. Globally, it lets prose split mid-word.
- **Long-word languages / technical prose** — `hyphens: auto` with a correct `lang` on `<html>`, and `hyphenate-limit-chars: 6 3 3` so short words stay whole.
- **The measure itself.** No wrapping algorithm rescues a 100ch line or a 35ch one. ~62ch for body, wider only via a deliberate breakout (`layout-editorial-rail`), and heading `max-inline-size` in `ch` when a two-line break keeps landing on a preposition.

`references/wrapping.md` has the full table — browser support, the `balance` line-count caps, hanging punctuation, justified-text cautions, a widont fallback for headings in old engines, and how to read a rag.

## Judging the result

Look at the silhouette, not the words. A heading should be a near-rectangle. A paragraph's right edge should be a soft sawtooth — no line far shorter than its neighbours, no three lines exactly the same length, no single word on the last line. If the shape is wrong after `balance`/`pretty`, the fix is almost always the measure or a nowrap, not more CSS.

## Quick check

1. Every heading selector and `.editorial-title` has `text-wrap: balance`; no paragraph does.
2. `p, li, blockquote` have `text-wrap: pretty`.
3. Dates, names with titles, numbers with units are wrapped in `.nowrap` or joined with `&nbsp;` / `&#8239;`.
4. `overflow-wrap: anywhere` appears only on URL/code/identifier selectors.
5. `<html lang>` is set if `hyphens: auto` is used.

Attribution

fernandokylasfernandokylas
View sourceMore from fernandokylas →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Responsive Design

Implement modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first breakpoint strategies. Use when building adaptive interfaces, implementing fluid layouts, or creating component-level responsive behavior.

393432 votes

Mermaid Diagrams

Creating and refining Mermaid diagrams with live reload. Use when users want flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, or any other Mermaid visualization. Provides best practices for syntax, styling, and the iterative workflow using mermaid_preview and mermaid_save tools.

2032 votes

sleek-design-mobile-apps

Use when the user wants to design a mobile app, create screens, build UI, or interact with their Sleek projects. Covers high-level requests ("design an app that does X") and specific ones ("list my projects", "create a new project", "screenshot that screen").

5711 votes

swiftui-design-skill

SwiftUI frontend visual design skill. Creates beautiful, distinctive iOS/macOS interfaces that avoid generic AI slop patterns. Covers design direction, layout systems, typography, color, spacing, brand integration, and design review. Use when designing new SwiftUI views, reviewing UI quality, creating iOS prototypes, choosing visual styles, improving app aesthetics, or when the UI looks generic or AI-generated.

1801 votes

Ios Hig

Use when designing iOS interfaces, implementing accessibility (VoiceOver, Dynamic Type), handling dark mode, ensuring adequate touch targets, providing animation/haptic feedback, or requesting user permissions. Apple Human Interface Guidelines for iOS compliance.

761 votes
View all in design →