$npx -y skills add rshankras/claude-code-apple-skills --skill typographyUI typography on Apple platforms — text styles and Dynamic Type, the San Francisco family (Pro/Rounded/Compact/Mono/New York + width axis), optical sizes, tracking vs kerning, leading adjustments, and custom-font scaling. Use when choosing fonts, building type hierarchy, fixing t
| 1 | # Typography |
| 2 | |
| 3 | Type is most of your UI. The system does the hard parts — optical sizes, tracking tables, |
| 4 | Dynamic Type — *if* you use its APIs. This skill covers when to trust the system, how to build |
| 5 | hierarchy deliberately, and what custom fonts owe you back. |
| 6 | |
| 7 | ## When This Skill Activates |
| 8 | |
| 9 | - Choosing fonts or building a type hierarchy for a screen or app |
| 10 | - Text truncating, cramping, or breaking under larger Dynamic Type sizes |
| 11 | - Adopting a custom/brand font (and keeping accessibility) |
| 12 | - Display typesetting: hero numbers, stats, editorial headlines |
| 13 | |
| 14 | ## Rule 1: text styles first |
| 15 | |
| 16 | Predefined styles (Large Title → Caption 2) are weight + size + leading combos with Dynamic |
| 17 | Type support built in — and different styles scale *differently* (body grows more than |
| 18 | footnote), which manual font sizes can't replicate. |
| 19 | |
| 20 | - Build hierarchy from 2–3 text styles + emphasized variants (bold trait — the actual weight |
| 21 | varies per style: some go medium→semibold, others bold→heavy) before reaching for new fonts. |
| 22 | - Semantic colors + text styles together give dark mode, contrast, and Dynamic Type for free. |
| 23 | - macOS supports text styles (without Dynamic Type); design Mac type at 100% — no iOS-style |
| 24 | scaling assumptions. |
| 25 | |
| 26 | ## Rule 2: let optical sizes and tracking work |
| 27 | |
| 28 | - San Francisco blends Text→Display designs **continuously between 17 and 28pt** (below: sturdier |
| 29 | letterforms, looser tracking for legibility; above: tighter, more refined). System font APIs do |
| 30 | this automatically — hardcoded single-cut fonts don't. |
| 31 | - **Tracking, not kerning**, for letterspacing — tracking is size-specific and lets the OS |
| 32 | disable clashing features (ligatures). Override system tracking only in exceptional cases. |
| 33 | - Truncation pressure? Use `allowsTightening` (default-tightening-for-truncation) instead of |
| 34 | manually squeezing — and prefer wrapping to truncating (line limit 0 on labels that matter). |
| 35 | - Line height moves only via leading traits: tight = −2pt, loose = +2pt (±1pt on watchOS); the |
| 36 | system adds leading automatically for tall scripts (Arabic, Devanagari). |
| 37 | |
| 38 | ## The Dynamic Type ladder (WWDC24 10074) |
| 39 | |
| 40 | 12 sizes: 7 default + 5 accessibility (AX1–AX5). `.body` runs 17pt at default up to 53pt |
| 41 | at AX5 — roughly 3× taller, and layouts must expect that. Escalate in order: |
| 42 | |
| 43 | 1. **Text styles** — `.font(.title)` / `preferredFont(forTextStyle:)` + |
| 44 | adjusts-for-content-size, line count 0 so text wraps instead of truncating. |
| 45 | 2. **`@ScaledMetric`** for the non-text riding alongside (icon frames, spacing); SF |
| 46 | Symbols scale via `UIImage.SymbolConfiguration(textStyle:)`. Prioritize scaling |
| 47 | essential content over decoration. |
| 48 | 3. **Switch layout axis at accessibility sizes** — branch on |
| 49 | `dynamicTypeSize.isAccessibilitySize` with `AnyLayout(HStackLayout())` / |
| 50 | `AnyLayout(VStackLayout())` (UIKit: flip the stack axis on |
| 51 | `preferredContentSizeCategory.isAccessibilityCategory`); give text the full line |
| 52 | width and relax `lineLimit`. |
| 53 | 4. **Large Content Viewer** — only for bars that legitimately can't grow: a tab bar takes |
| 54 | under 10% of screen height, and scaled to accessibility sizes it would eat almost a |
| 55 | quarter (WWDC24 10074). Scaling is always preferred; the viewer is the fallback, not |
| 56 | the fix. |
| 57 | |
| 58 | Test at all 12 sizes (Xcode Previews → Variants → Dynamic Type Variants), not just the |
| 59 | biggest — mid-range accessibility sizes catch different wrap points. |
| 60 | |
| 61 | ## The San Francisco family — pick by job |
| 62 | |
| 63 | | Face | Job | |
| 64 | |---|---| |
| 65 | | SF Pro | The default; UI text everywhere | |
| 66 | | SF Pro Rounded | Friendlier numerals/labels — widgets, health/fitness data | |
| 67 | | SF Compact | watchOS (space-efficient counterpart) | |
| 68 | | SF Mono | Code, tabular alignment | |
| 69 | | New York | Serif — reading experiences, editorial contrast | |
| 70 | | SF Arabic / SF Arabic Rounded | Arabic script with its own optical sizes | |
| 71 | |
| 72 | **The width axis** (Condensed / Regular / Compressed / Expanded): |
| 73 | |
| 74 | - Default Regular; every non-Regular choice is a legibility decision — check it. |
| 75 | - Condensed: fit more text comfortably (long headlines wrap one line fewer). |
| 76 | - Compressed: display-only density, not body text. |
| 77 | - Expanded: display typesetting AND small secondary labels (wide + loose tracking). |
| 78 | - Width is a **fourth hierarchy lever** beside weight, size, color; all widths share identical |
| 79 | vertical proportions, so mixing them never misaligns baselines. 2–3 styles are enough — |
| 80 | pair one width with contrasting weights, one weight with contrasting widths, or oppose both |
| 81 | for maximum display contrast. |
| 82 | |
| 83 | ## Custom fonts: what you owe back |
| 84 | |
| 85 | System fonts |