Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

React
  • One Request, Two Answers: the Same Post as an HTML Page and as JSON
  • A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
  • How a Web Page Works: HTML Tags, Elements and Attributes
  • Semantic HTML: header, nav, main, aside and footer as Page Landmarks
  • HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)
  • CSS Basics: Selectors, Which Rule Wins, and the Box Model
  • CSS Flexbox vs Grid: A Nav Bar, a Card Row and a Dashboard
  • Responsive CSS: Viewport, Mobile-First Media Queries, clamp() and Dark Mode with Tokens
  • JavaScript for People Who Already Code: Syntax, Modules and Five Surprises
  • JavaScript Arrays the Functional Way: map, filter, reduce, find, sort and Object.entries
  • Async JavaScript: Promises, async/await, fetch and Promise.all
  • JavaScript in the Page: the DOM, querySelector and Events
  • npm, package.json and Vite: What npm install Fetches and How Vite Serves and Builds Your Page
  • TypeScript Essentials: Types Checked, Then Erased (Interfaces, Unions, Generics)
  • Why React, JSX and Components: The Page as a Function of Data
  • React Props and Composition: Data Down, Calls Up, Children in the Slot
  • Routing With React Router: One Page, Many Addresses
  • React Component Tests With Vitest and Testing Library: Test What the User Sees
  • End-to-End Tests for a React App With Playwright: A Full Dress Rehearsal
  • Why AI-Built Websites All Look the Same, and Four Levels That Fix It
  • Visual Hierarchy, Spacing and the 8-Point Grid: Tell the Eye What to Read First
  • Colour, Contrast and Dark Palettes: 60-30-10, Semantic Tokens and Ratios You Can Compute
  • Typography That Sells: Type Scale, Line Length and Free Font Pairings
  • The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
  • Design Tokens: Primitive and Semantic Tokens, from Figma to CSS to Tailwind
  • Tailwind CSS 4 in React: Utility Classes, Responsive Prefixes, Hover and Dark Mode
  • shadcn/ui in React: Components You Own, Edit and Commit
  • Design Tokens to a Tailwind Theme: Light and Dark Mode with @theme inline
  • Motion in React: Entrance, Hover, Exit and Layout Animations
  • A React Dashboard: Stat Cards, a Recharts Line Chart and a Sortable Table
  • Accessibility in Practice: Dialogs, Menus and the Keyboard in React
  • Reference-Driven Design: Extract a DESIGN.md From a Site You Admire and Build From It
  • Components, Variants and Variables: One Design System in Figma and in CSS
  • Figma MCP Server: Build a React Component From a Frame, Then Write It Back
  • Claude Design: From a Brief to a Clickable Prototype, Then Hand It Off to Claude Code
  • Critiquing AI-Generated UI: Six Checks for Every Screen
  • The AI Design Landscape: Prompt to UI, Prompt to App, and Design to Code
  • Your Brand Rules Folder: One Folder Every AI-Built Page Follows
  • The Best-Practice UI Prompt: Plain Sentences That Beat the Average AI Page
  • UI Ideas From Figma Make, Google Stitch and ChatGPT: One Prompt, Three Designs
  • Google Stitch From a Sketch or Screenshot: Show the Layout, Say What to Keep
  • Stitch to Figma to Code: Turn a Stitch Screen Into Code That Uses Your Tokens
  • Figma Make: Prompt to Prototype With a Four-Part Prompt
  • Upgrade a Dated UI From One Screenshot (or a Reference Image)
  • States and Feedback: Make Every Click Get an Answer
  • A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI
  • Copy Without the AI Tells: A Copy Pass on a Landing Page
  • React State, Events, Lists and Conditional Rendering: Follow One Click
  • React useEffect: When It Runs, What Cleanup Is For, and When You Don't Need One
  • Lifting State Up, Refs and React DevTools: Put State Where It Is Needed
  • Forms and Actions in React 19: Controlled Inputs, Form Actions, useActionState and useFormStatus
  • React Context and Custom Hooks: Share One Value, Reuse the Logic
  • Server State With TanStack Query: One Key, One Request, One Cache
  • Mutations and Optimistic Updates in TanStack Query: Change Data, Then Tell the Cache
  • Generate TypeScript Types, Query Hooks and Zod From an OpenAPI Spec With Orval
  • A Mock Backend in the Browser With Mock Service Worker, Generated From the Spec
  • A React Client for a FastAPI API: The CORS Wall, CORSMiddleware and the Vite Proxy
  • Forms With React Hook Form and Zod: The API's Rules in the Browser, the Server's Errors Under the Field
  • JWT Auth in a React Client With a FastAPI Backend: Log In, Carry the Token, Let the Server Decide
  1. Blog
  2. /
  3. React
  4. /
  5. Fundamentals

Typography That Sells: Type Scale, Line Length and Free Font Pairings

Free fonts that do not look free: a type scale with base 1rem and ratio 1.25, lines of 65ch, three Google Fonts pairings for editorial, product and friendly pages, and a font selector in DESIGN.md.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Fundamentals

What you will learn

  • Build a type scale from one base size and a 1.25 ratio as CSS variables
  • Keep paragraphs between 45 and 75 characters with max-width: 65ch
  • Pair a heading font and a body font from Google Fonts on purpose
  • Write a font selector into DESIGN.md so AI agents stop defaulting to Inter

Before you start

  • Basic HTML and CSS
  • Visual Hierarchy, Spacing and the 8-Point Grid

Most AI-built pages use random font sizes: 18 here, 27 there. They also use Inter for everything. The page feels a bit messy and a bit generic, and it is hard to say why.

Typography fixes both, and it is cheaper than you think. All the fonts in this article are free from Google Fonts. What makes them look like a paid design is a few rules: a type scale, a sensible line length, and a pairing chosen on purpose.

Pick a ratio, then every size is a step

Pick one base size and one ratio. Here the base is 1rem and the ratio is 1.25. Each step is the one below it times 1.25:

A type scale with base 1rem and ratio 1.25 Heading one--step-4: 2.441rem Heading two--step-3: 1.953rem Heading three--step-2: 1.563rem Lead paragraph--step-1: 1.25rem Body text sits on step zero--step-0: 1rem Small print, one step below--step--1: 0.8rem Each step = the one below x 1.25
One base, one ratio. Samples drawn at 16px per rem.

In code these are just variables, written once in :root. This is from the project's scale.html:

:root {
  /* one base size, one ratio (1.25): every size is a step */
  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
}
body { font-family: "DM Sans", sans-serif; font-size: var(--step-0); line-height: 1.5; max-width: 720px; margin: 32px auto; color: #1e293b; }
h1 { font-size: var(--step-4); line-height: 1.1; margin: 0 0 .4em; }
h2 { font-size: var(--step-3); line-height: 1.15; margin: 0 0 .4em; }
h3 { font-size: var(--step-2); line-height: 1.2; margin: 0 0 .4em; }
.lead { font-size: var(--step-1); }
small { font-size: var(--step--1); color: #64748b; }

Body text sits on step zero. Headings get a tight line height (1.1 to 1.2), body text gets a relaxed one (1.5). No more random sizes.

Keep a line between 45 and 75 characters

Imagine a paragraph that runs across a whole wide screen, more than a hundred characters per line. Your eyes lose their place every time they jump back to the start of the next line, and most people give up before the end. At about 65 characters per line, your eyes find the next line without effort.

The CSS for it is tiny. From measure.html:

.too-long { max-width: none; }   /* about 110 characters per line on a wide screen */
.right { max-width: 65ch; }      /* 45 to 75 characters per line */

The ch unit is the width of one character, so max-width: 65ch keeps the line length in range by itself, whatever the font size.

One font with character, one that stays quiet

Three rules for pairing two fonts:

  1. Two families, no more. One for headings, one for body text.
  2. Different, but friendly. A serif with a sans, or a sans with a different feel.
  3. Not the default. If every AI tool picks Inter, your site looks like everybody else's site.

The project has three sample pages, one for each kind of product.

Editorial: Playfair Display and Source Sans 3

The Reading Room blog page: a large Playfair Display serif headline Why slow mornings make better work, a body paragraph in Source Sans 3 and a dark Read the essay button on a warm off-white background.
pair1-editorial.html: a serif heading that feels like a magazine.

The heading has a lot of character and the body is calm and clear for long paragraphs. Best for blogs, magazines and anything people read slowly. The fonts are set once as variables:

:root { --heading: "Playfair Display", Georgia, serif; --body: "Source Sans 3", system-ui, sans-serif; }

Product: Space Grotesk and DM Sans

Plan and Do landing page on a dark navy background: a Space Grotesk headline Plan your week in five minutes with the last words in light blue, a DM Sans body line and a light blue Start for free button.
pair2-product.html: a modern heading with a slightly technical feel.

Space Grotesk has a modern, slightly technical shape, and DM Sans is very clean. Best for apps, dashboards and tech products.

Friendly: Fraunces and Nunito Sans

Maple and Rye Bakery page on a cream background: a soft, round Fraunces headline Fresh bread, baked before sunrise in rust red, a Nunito Sans body line and an orange pill-shaped Order a loaf button.
pair3-friendly.html: soft, round letters for a local shop.

Fraunces has soft, round letters, and Nunito Sans keeps the body warm and easy. Best for local shops, food, schools and friendly brands.

Write it into DESIGN.md

AI agents love to default to Inter. To stop that, write a font selector into the design system file the agent reads, DESIGN.md. This is the project's typography section:

# DESIGN.md (typography section)

## Font selector (the agent must follow this before writing any CSS)

Never default to Inter, Roboto or Arial. Pick the pairing that matches the product, then use it everywhere.

| Product feel            | Heading font       | Body font      |
|-------------------------|--------------------|----------------|
| Editorial, trustworthy  | Playfair Display   | Source Sans 3  |
| Modern product, techy   | Space Grotesk      | DM Sans        |
| Warm, friendly, local   | Fraunces           | Nunito Sans    |

Rules:
- Load the fonts from Google Fonts. Two families only: one for headings, one for body.
- Type scale: base 1rem, ratio 1.25 (0.8, 1, 1.25, 1.563, 1.953, 2.441 rem) as CSS variables.
- Body line-height 1.5 to 1.65. Headings 1.1 to 1.2.
- Paragraphs: max-width 65ch (45 to 75 characters per line).
- Define --heading and --body in :root and never write a font name anywhere else.

It opens with one blunt line, never default to Inter, Roboto or Arial. Then a table that maps the product feel to a pairing, and the rules: two families, the 1.25 scale, body line height 1.5 to 1.65, paragraphs at 65ch, and the fonts in two variables, --heading and --body. Now the agent picks from your list instead of falling back to Inter. This is the typography level from why AI-built sites all look the same, written down so the agent cannot skip it. To build a whole DESIGN.md from a site you like, see reference-driven design.

Common mistakes

  • Three or four font families. The rule is two: one for headings, one for body.
  • Two loud fonts together. A display serif with a display sans fight each other. One font has character, the other stays quiet.
  • Full-width paragraphs. Without a max-width, a wide screen gives you 100+ characters per line.
  • Font names scattered through the CSS. Put them in --heading and --body and never write a font name anywhere else.

Six things to check before you ship

CheckRule
Type scaleOne base (1rem), one ratio (1.25)
Line length45 to 75 characters, max-width: 65ch
Two fontsOne for headings, one for body
Free fontsFrom Google Fonts, chosen on purpose
Font selectorWritten into DESIGN.md
Line heightAbout 1.5 for body, about 1.1 for headings

You do not have to memorise any of this. Learn the foundations, and let AI do the typing. Try it yourself: pick the pairing that fits your own product, paste the DESIGN.md section into a prompt and ask for a landing page. Then check the result against the six rows above.

Keep going in React · 23 of 59

Previous
Colour, Contrast and Dark Palettes: 60-30-10, Semantic Tokens and Ratios You Can Compute
Next post
The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Related posts

One Request, Two Answers: the Same Post as an HTML Page and as JSON

Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.

A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx

Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.

How a Web Page Works: HTML Tags, Elements and Attributes

A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.

Semantic HTML: header, nav, main, aside and footer as Page Landmarks

The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.

On this page

  • Pick a ratio, then every size is a step
  • Keep a line between 45 and 75 characters
  • One font with character, one that stays quiet
  • Editorial: Playfair Display and Source Sans 3
  • Product: Space Grotesk and DM Sans
  • Friendly: Fraunces and Nunito Sans
  • Write it into DESIGN.md
  • Common mistakes
  • Six things to check before you ship
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.