Skip to content
Design Fundamentals

How to Create a Typographic Scale and Colour Palette

Font sizes from a ratio, a full palette from one colour

Updated: 6 min read

Start reading

In short: A typographic scale ties all your font sizes to a single ratio. First you choose the body text size, then you make each heading level a set multiple of the previous one (for example 1.25 or 1.333). You build a colour palette in a similar way: you generate lighter and darker shades from the brand colour, and each shade has a job. Both systems share the same goal. Instead of inventing a new value for every decision, you choose from a limited, consistent list.

The short version…

In other posts I explained choosing spacing from a scale and choosing fonts. This post applies the same logic to font sizes and colours. By the end, you’ll have two short lists: the font sizes you can use and the colour shades you can use. You’ll find the basics of font selection in my post on how to choose fonts in web design. For contrast, see my post on colour contrast.

What is a typographic scale?

A typographic scale derives all the font sizes on a page from a single base value and a single ratio. The base is usually the body text (16 pixels). The ratios take their names from musical intervals. For example, 1.2 is called a minor third, 1.25 a major third and 1.333 a perfect fourth. And 1.5 is a perfect fifth, while 1.618 is the golden ratio.

Three typographic scales starting from 16-pixel body text: heading sizes with ratios of 1.25, 1.333 and 1.618
The bigger the ratio, the sharper the difference between headings.

Which ratio should you choose for a typographic scale?

RatioCharacterWhere does it fit?
1.2–1.25Soft, calmBlogs with many heading levels, documentation, app interfaces
1.333BalancedCorporate sites, general-purpose websites
1.5–1.618Strong, dramaticLanding and campaign pages, designs with little text

I explained using the golden ratio as a typographic scale in detail in my post on the golden ratio. However, as the ratio grows, the largest heading becomes too big to fit on mobile. That’s why we usually use large ratios only on desktop.

Typographic scale in practice: round and limit

  • Round the values you calculate: 16 × 1.25 = 20; 20 × 1.25 = 25; 25 × 1.25 = 31.25 → 31 or 32.
  • Limit the sizes you use, because 5–6 sizes are enough for most sites (small text, body, H4, H3, H2, H1).
  • Adjust line height to the size: around 1.5 for body text, 1.1–1.2 for large headings.

A fluid typographic scale: CSS clamp()

Say you want to use a 1.333 ratio on desktop and 1.2 on mobile. You don’t need to define separate sizes for every screen, because CSS’s clamp() function does the job. For example, font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem); scales a heading fluidly between 32 and 56 pixels depending on screen width (MDN). Free tools like Utopia make this easier too. You enter two screen sizes and two ratios, and the tool generates all the typographic scale values with clamp() (Utopia).

Creating a colour palette

Beginners usually add a few “matching” colours next to the brand colour and consider the palette done. But in an interface, colours have jobs: background, text, border, accent, warning. A single brand colour can’t do all of these. It is often too light for text and too dark for a background. So the solution is to generate a range of shades from each main colour.

A ten-shade palette from 50 to 900 for navy and plum, with each shade’s contrast ratio against a white background
Ten shades of each colour from 50 to 900; the numbers are the contrast ratio against a white background.

Step by step

  1. Choose the main colours: a brand colour, a neutral (grey) and, if needed, a secondary colour. Then add the status colours: success (green), warning (yellow), error (red).
  2. Generate shades of each colour: treat the main colour as the middle shade (500). Then mix it with white to get lighter shades (50–400) and with black to get darker shades (600–900).
  3. Give the shades jobs: for example 50–100 for backgrounds and highlighted areas, 200–300 for borders, 500–600 for buttons, 700–900 for text.
  4. Measure the contrast: any shade you use as text on a white background needs a contrast of at least 4.5:1. The numbers in the image make this easier.
  5. Don’t neglect the greys: most of an interface is neutral colours. And greys with a slight tint of the brand colour look more harmonious than pure grey.

I explained the 60-30-10 rule for the proportion of colours on a page in my post on colour contrast.

A palette for dark mode

Dark mode isn’t just the light palette inverted. Pure white text on a pure black (#000000) background often strains the eyes. Saturated colours also vibrate on a dark background. Google’s Material Design guidelines recommend dark grey (#121212) as the background in a dark theme. The same guidelines also recommend choosing lighter, less saturated shades of your colours (Material Design). That way, the light shades of your palette (200–300) work as accent colours in dark mode.

Keeping the typographic scale and palette in code

These decisions only pay off when you keep them in the code too. The simplest way is to define the typographic scale and colours as CSS variables:

--fs-body: 1rem; --fs-h3: 1.333rem; --fs-h2: 1.777rem; --color-primary-500: #213D7C; --color-primary-50: #EEF1F7;

In WordPress block themes, you write the same values into the theme.json file, so they also appear as options in the editor. When a team shares these lists, they become the foundation of a design system. I explained defining the same values as variables in Figma in my Figma guide.

Frequently asked questions

What pixel size should I choose for body text?

For the web, 16 pixels is a safe minimum. On reading-heavy sites, 17–18 pixels is often more comfortable. If the font has a small x-height, increase the size a little.

How many colours should a palette have?

A brand colour, a neutral and three status colours (success, warning, error) are enough for most sites. With 8–10 shades each, that comes to around 50 values. But the number of shades you actually use is much smaller.

Are ready-made palette generators useful?

Yes, many tools generate a range of shades from a single colour. Still, measure the contrast of the shades they produce, because tools balance colours aesthetically but don’t guarantee readability.

This post is based on information valid as of November 2026.

Sources

Front-end developer and web designer, Istanbul

Working on web design, e-commerce and brand identity since 2000. At cyhn.net, design, development and content come together at one table.

More posts

All posts