better-typography
Skill0 starsChanged 2 months agoMITView on GitHub
Web typography from choosing fonts to spacing, wrapping and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType features, setting up a type scale, styling text in components, truncating text, styling underlines, selection, placeholders or carets, or reviewing frontend code for typography. Triggers on typography, fonts, font formats, woff2, variable fonts, font-weight, opentype, font-feature-settings, letter-spacing, line-height, type scale, tabular numbers, text-wrap, truncation, line clamp, underlines, text-decoration, text selection, iOS input zoom, font smoothing, text contrast, measure, line length, text-box, smart punctuation, drop cap.
37 other projects use a version of this, 25 of them edited.
Adopted by
Most recently taken up by
- Masih-0x3/agent-skillsedited, first seen Nov 29, 2026
- anis-dr/skillstheir own version, first seen Nov 29, 2026
- TudorAndrei/skillstheir own version, first seen Nov 29, 2026
- compozy/compozyedited, first seen Nov 28, 2026
- jjfantini/humblSKILLStheir own version, first seen Nov 22, 2026
- iricardofernandes/skillstheir own version, first seen Nov 22, 2026
Used with
Projects with it also use build-design, improve-ui and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
stritarSkillbuild-design
Builds UI from a Figma file or a design image so it matches the design, using the project's existing tokens and components.
Also in 3 projects that use this
Discriminative-shoji607Skillimprove-ui
Audit an existing product surface against its own design evidence, identify verified UI problems, and write self-contained implementation plans for another agent. Strictly read-only on product source. Use when asked to review, refine, improve, or clean up an interface without replacing its identity; investigate design-system drift; or prepare a design handoff.
Also in 3 projects that use this
sanmidableSkillgood-css
Also in 3 projects that use this
MicrosoftSkillmobile-native
Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.
Also in 6 projects that use this
ItamarZand88Skillcreate-design-md
Create a new DESIGN.md file for any website, app, or custom design system. Use when the user wants to document a design system in DESIGN.md format, extract design tokens from a URL or existing CSS, create a custom design system from scratch, author a DESIGN.md for their own project, or contribute a new design to the awesome-design-md collection. Also trigger when user mentions "design system documentation", wants to formalize their app's visual language, or asks to create or generate a DESIGN.md file.
Also in 3 projects that use this
MicrosoftSkillgestures
Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible. Use when building or fixing anything the user drags, swipes, flings, holds, or dismisses with a gesture — drawers, sheets, swipe-to-dismiss toasts and cards, drag-to-reorder, pull-to-refresh, hold-to-confirm — or when a gesture feels laggy, disconnected from the finger, jumps on release, or can't be caught mid-animation. Triggers on — gesture, drag, swipe, fling, sheet, snap points, Vaul, Motion drag props, rubber-band, pull to refresh, hold to delete, touch-action, "doesn't follow my finger", "jumps when I let go", "can't grab it mid-animation".
Also in 3 projects that use this
- +4 more from microsoft
Other versions37 projects use a version of this.
Word for word · 1
- amanjotx/Agent-Skills★ 0100% same
Edited · 25
- trycompai/crm★ 12k55% same
- talebook/talebook★ 5.9k54% same
- compozy/compozy★ 2.9k29% same
- moumen-soliman/uitripled★ 1.4k29% same
- genex-games/genex-desktop★ 91829% same
- Atharvsinh-codez/ObsidianUI★ 64554% same
- boraoztunc/skills★ 47354% same
- Dimon94/dverity★ 10729% same
- Dimon94/skills★ 10729% same
- Tresnanda/kybern★ 10229% same
15 more not listed
Wrote their own version · 11
- jakubkrehel/skills★ 13ksame name
- transitive-bullshit/skills★ 6same name
- anis-dr/skills★ 4same name
- hsynozdamar-byte/claude-skills-edited★ 4same name
- sanmidable/skills★ 2same name
- iricardofernandes/skills★ 1same name
- TudorAndrei/skills★ 1same name
- atpaawej/opencode-skillpack★ 0same name
- cill-i-am/skills★ 0same name
- jjfantini/humblSKILLS★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- agent-browserSkill
- anti-slopSkill
- better-colorsSkill
- better-uiSkill
- hydrateSkill
- ingestSkill
- make-interfaces-feel-betterSkill
- shipSkill
- simplySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 36 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
When a weight or style is not loaded, the browser synthesizes it.
“Common” is measured: kept by at least 6 in 10 of the 36 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vendored from jakubkrehel/skills by Jakub Krehel. MIT — see LICENSE.
Great typography
Good typography is mostly restraint. A sensible scale, comfortable spacing and enough contrast beat any clever effect. A label, a table cell, a marketing headline and an article paragraph should not share one set of rules. Apply these principles when building or reviewing anything with text in it.
Match the project's styling system. Before suggesting or writing any fix, check how the codebase styles things and express every change in that system: Tailwind utilities in a Tailwind project, plain declarations in CSS, CSS Modules, styled-components or StyleX. The cheat sheet maps each declaration to its Tailwind equivalent. Never introduce a second styling approach just to apply a typography fix.
Quick Reference
| Category | When to use | Reference |
| Choosing fonts | Font categories, pairing, formats, typeface anatomy | choosing-fonts.md |
| Variable fonts & OpenType | Axes, weights, tabular numbers, stylistic sets | variable-fonts-and-opentype.md |
| Spacing & sizing | Type scale, line-height, letter-spacing, text trimming | spacing-and-sizing.md |
| Wrapping & punctuation | Measure, wrapping, truncation, smart punctuation, RTL | wrapping-and-punctuation.md |
| Details & accessibility | Underlines, selection, forms, decorative text, contrast | details-and-accessibility.md |
| CSS cheat sheet | Quick lookup of every property covered, with Tailwind equivalents | css-cheat-sheet.md |
Core Principles
1. Serve the Right Format
Use .woff2 (Brotli compression, broadly supported) on the web. .woff is a fallback only for very old browsers; .ttf and .otf are raw desktop formats with no web compression. How the files are loaded is the project's own concern, this skill does not prescribe it.
2. Properties Over Raw Tags
When a CSS property exists, use it. font-weight: 650 instead of font-variation-settings: "wght" 650, font-optical-sizing: auto instead of "opsz", font-variant-numeric: tabular-nums instead of font-feature-settings: "tnum" 1. Properties keep working when a non-variable fallback renders. Reserve the raw-tag properties for custom axes ("GRAD" 80) and niche features ("ss01" 1) that have no property of their own.
3. No Fake Weights
When a weight or style is not loaded, the browser synthesizes it. That is a safety mechanism, not a feature. Set font-synthesis: none so missing files fail visibly instead of rendering a faked bold or italic.
4. Fewer Fonts, Sizes and Weights
Rarely use more than three fonts. Weight and size define hierarchy, but overusing them hurts readability quickly. Pair for contrast, not similarity: a serif headline with a sans body reads as deliberate, two near-identical sans-serifs read as a mistake.
5. Use a Type Scale with Semantic Names
Define a small set of sizes and deviate from it as little as possible. Hard-coded sizes without a system break down at scale. For solo projects, default names like text-sm work fine as long as the usage rules are clear. On a team, name sizes by use (text-body-sm), not by size, so the rules stay consistent.
6. Line-Height by Role
Headings tighter, around 1.1. Body copy 1.5 to 1.6. Prefer unitless values so line-height scales with the font size; fixed values like 24px do not.
7. Letter-Spacing by Size
Large headings often look better with slightly negative letter-spacing. Small uppercase labels need a little positive letter-spacing so letters do not feel crowded. Body copy at reading sizes needs neither.
8. Cap the Measure
Long lines make it hard for the eye to find the next line. Cap long-form text around 60–75 characters per line. Any unit works: 65ch measures characters directly, and a pixel or rem cap is just as good — at a 16px body size the range lands roughly between 560px and 680px depending on the font, so Tailwind's max-w-xl or max-w-2xl fit. What matters is that a cap exists and the resulting line length sits in range.
9. Wrap Deliberately
text-wrap: balance distributes text evenly across lines: use it on headings. text-wrap: pretty avoids leaving a single short word on the final line: use it on descriptions. Skip both in long-form text: browsers ignore balance past a few lines anyway, and evening out a whole paragraph wastes space and makes it harder to read. overflow-wrap: break-word where long words, links or IDs could escape the container. white-space: nowrap on labels and badges where a line break looks broken.
10. Tabular Numbers on Changing Values
Digits have different widths by default, so timers, counters and prices shift layout as they update. Apply font-variant-numeric: tabular-nums to any value that changes.
11. Truncate Without Losing Content
Single line: text-overflow: ellipsis with overflow: hidden and white-space: nowrap. Multiple lines: line-clamp. Truncation hides content, so if the missing text matters, keep the full value reachable in a tooltip or expanded view.
12. Write Copy Naturally, Style with CSS
Store text in natural case and control presentation with text-transform, so redesigns never require rewriting copy. Use smart punctuation: curly quotes in prose (straight quotes in code), an en dash for ranges like 2010–2020, an em dash to set off a thought, the single ellipsis character, to keep values like 16 px together and ­ to control where long words may break.
13. Underlines from the Font
Default underlines sit wherever the browser decides. Pull position and thickness from the font's own metrics with text-underline-position: from-font and text-decoration-thickness: from-font, or tune manually with text-decoration-thickness, text-underline-offset and text-decoration-skip-ink. text-decoration-style draws the line dotted, dashed or wavy; a dotted underline is a common hint that a word carries extra information, like an abbreviation or a defined term. Unless the only thing animating is a color change, build the underline as a separate element instead of using text-decoration — color is the only part of a real underline that animates reliably.
14. Inputs at 16px on Mobile
iOS Safari zooms the whole page when an input's text is smaller than 16px. Keep input text at 16px on mobile viewports (text-base sm:text-sm). Avoid the maximum-scale=1 viewport meta: Safari ignores it for pinch zoom, but every other browser honors it and blocks zooming, which fails WCAG.
15. Size and Contrast Floors
Body text 16px (the web default and the right reading size). UI text can go smaller: 14px for inputs and menus (inputs still need 16px on mobile, see principle 14), 13px for captions, rarely below 12px. WCAG AA: 4.5:1 contrast for regular text, 3:1 for large text (roughly 24px and up).
16. Font Smoothing on the Root
On macOS text renders heavier than intended. Apply -webkit-font-smoothing: antialiased and -moz-osx-font-smoothing: grayscale (both covered by Tailwind's antialiased) once on the root layout so they cover all text.
17. Logical Properties for Direction
To support right-to-left content, use direction-agnostic properties: margin-inline-start instead of margin-left, text-align: start instead of left. Set lang so browsers pick the right quotes and hyphenation, and dir="rtl" where needed.
18. Style the Selection, Disable It Where It Distracts
::selection is a subtle way to embed brand in the reading experience; keep the combination legible. Use user-select: none on button labels where copying is unlikely and selection feels distracting, and make sure cmd+A only grabs text the user expects to copy. In cross-platform apps that feel closer to native, disable selection for the interface and keep it only on content worth copying.
Review Output Format
Always present changes as a markdown table with Before and After columns. Include every change you made, not just a subset. Never list findings as separate "Before:" / "After:" lines outside of a table. Group changes by principle using a heading above each table, and keep each row focused on a single diff. Write every After snippet in the styling system the project already uses.
Example
Tabular numbers
| Before | After |
<span>{price}</span> on live price | <span className="tabular-nums">{price}</span> |
font-feature-settings: "tnum" 1 | font-variant-numeric: tabular-nums |
Line-height and measure
| Before | After |
leading-none on body paragraph | leading-normal (body needs 1.5–1.6) |
| Full-width article column | max-w-2xl (~65 characters per line at 16px) |
Rows should cite the specific file and property when it is not obvious from the snippet. If a principle was reviewed but nothing needed to change, omit that table entirely.
Common Mistakes
| Mistake | Fix |
.ttf/.otf served on the web | Convert to .woff2 |
font-variation-settings: "wght" for weight | font-weight (works with non-variable fallbacks) |
font-feature-settings: "tnum" 1 | font-variant-numeric: tabular-nums |
| Browser-faked bold or italic | Load the file, set font-synthesis: none |
| Hard-coded one-off font sizes | Use the type scale |
line-height: 24px on scalable text | Unitless value (1.5) |
| Full-width paragraphs | Cap around 60–75 characters per line |
| Orphan on the last line of a paragraph | text-wrap: pretty |
| Lopsided two-line heading | text-wrap: balance |
| Numbers cause layout shift | tabular-nums |
| Truncated text with no way to read it | Tooltip or expanded view for the full value |
UPPERCASE typed into copy | Natural case + text-transform |
| Justified text in an interface | text-align: start; reserve justify for specific editorial layouts |
| Underline cuts through descenders | text-decoration-skip-ink: auto, from-font metrics |
Inputs below 16px zoom on iOS | text-base sm:text-sm |
margin-left in RTL-capable UI | margin-inline-start |
| Selectable button labels in native-feel UI | user-select: none, keep selection on real content |
| Extra-info hint with no visual cue | Dotted underline via text-decoration-style: dotted |
| Tailwind classes dropped into a CSS-in-JS codebase (or the reverse) | Express the fix in the styling system the project already uses |
Review Checklist
- Web fonts are
.woff2 font-weight/font-variant-*used instead of raw axis and feature tagsfont-synthesis: noneset; no faked weights or styles- Sizes come from the type scale, no one-off values
- Headings ~
1.1line-height, body1.5–1.6, unitless - Large headings have slightly negative tracking, small uppercase labels positive
- Long-form text capped around 60–75 characters per line
- Headings use
text-wrap: balance, body usestext-wrap: pretty - Changing numbers use
tabular-nums - Truncated content is reachable in full somewhere
- Copy stored in natural case, presentation via
text-transform - Underlines use
from-fontor tuned thickness, offset and skip-ink - Inputs are
16px+ on mobile viewports - Text sizes and contrast meet the floors (
16pxbody,4.5:1/3:1) antialiasedapplied once on the root layout- Directional properties are logical (
inline-start,start) - Any styled
::selectionstays legible
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

