Sub topic 6
Balancing colours with the 60-30-10 guideline
This chapter assumes you can write basic HTML and CSS, read HSL values, and already have a primary, a neutral scale, and an accent from the earlier chapters. Here you decide how much of each colour appears on a page.
What the guideline says
The 60-30-10 guideline is a rule of thumb for splitting the visible area of a page between three colour groups:
- 60% is the dominant colour. On most websites this is a neutral, such as the page background and large surfaces.
- 30% is the secondary colour. It supports the dominant colour and gives structure, for example headers, sidebars, cards, and body text.
- 10% is the accent. It marks the few things you want the eye to find first, such as the main button or a highlighted price.
The percentages describe visual weight, not exact pixel counts. A page that is roughly 60, 30, and 10 will feel balanced. A page that gives the accent 40% will feel loud and tiring, and one that gives it 0% will feel flat.
Mapping roles to the split
Your three colour roles map onto the three shares, but not always in the same way. The table shows two common arrangements.
| Share | Light brand site | Dark hero or app |
|---|---|---|
| 60% | Neutral (`--neutral-50` background) | Neutral (`--neutral-900` background) |
| 30% | Primary (header, links, cards with tinted fills) | Neutral (`--neutral-700` panels) plus text |
| 10% | Accent (`--accent-500` call to action) | Primary or accent for the main action |
Text counts toward the 30% share on many pages, because it covers a lot of area in thin strokes. Treat the guideline as a starting point for a layout, then adjust by eye.
Applying it in CSS
The simplest way to keep the proportions is to give each share a clear home in your stylesheet. The page background and large surfaces use neutrals. Structural elements use the primary. The accent appears only on a small set of elements.
:root {
--neutral-50: hsl(220 15% 97%);
--neutral-900: hsl(220 20% 12%);
--primary-500: hsl(220 80% 50%);
--primary-700: hsl(220 80% 34%);
--accent-500: hsl(35 95% 50%);
}
/* 60%: neutral background and large surfaces */
body {
background: var(--neutral-50);
color: var(--neutral-900);
}
/* 30%: primary for structure and links */
.site-header {
background: var(--primary-700);
color: var(--neutral-50);
}
a {
color: var(--primary-700);
}
/* 10%: accent for one main action per view */
.button-cta {
background: var(--accent-500);
color: var(--neutral-900);
}The accent button uses dark text. Orange at this lightness has low contrast against white, so the text colour has to be chosen with the accent's lightness in mind. The next chapters cover contrast checks in detail.
Common errors
- Using the accent everywhere. If links, icons, badges, and buttons are all orange, nothing stands out. Reserve the accent for one main action per view.
- Treating the numbers as exact. A page with a large photograph changes the real proportions. Judge the finished page, not the arithmetic.
- Giving the primary the 60%. A fully saturated primary background across the whole page strains the eye and leaves no room for emphasis. A tint of the primary, such as
--primary-100, is safer for large areas. - Forgetting state colours. Hover, focus, and error states add colour on top of your 10%. Keep them from competing with the main accent.
Checking the balance
You can estimate the split instead of guessing. Take a screenshot, then count how much of it each colour group covers. The script below does this for a list of pixel colours by assigning each pixel to its nearest palette colour.
const palette = {
neutral: [247, 248, 250],
primary: [17, 68, 153],
accent: [243, 156, 18],
};
function distance(a, b) {
return Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
}
function nearest(pixel) {
let best = null;
let bestDistance = Infinity;
for (const [name, color] of Object.entries(palette)) {
const d = distance(pixel, color);
if (d < bestDistance) {
bestDistance = d;
best = name;
}
}
return best;
}
function share(pixels) {
const counts = { neutral: 0, primary: 0, accent: 0 };
for (const pixel of pixels) {
counts[nearest(pixel)] += 1;
}
const result = {};
for (const name of Object.keys(counts)) {
result[name] = Math.round((counts[name] / pixels.length) * 100);
}
return result;
}
const sample = [
...Array(6).fill([247, 248, 250]),
...Array(3).fill([17, 68, 153]),
[243, 156, 18],
];
console.log(share(sample)); // { neutral: 60, primary: 30, accent: 10 }Real screenshots contain anti-aliased edges and photographs, so expect rough numbers. Use the result to spot a page that is far off, such as an accent share of 35%.
Exercise
A landing page has a pale neutral background, a dark blue header, and a bright orange button. After a redesign, the team also makes every link, icon, and badge orange. Which part of the 60-30-10 guideline does this break, and what is the fix?
Show answer
It breaks the 10% rule for the accent. The orange now covers far more than a small share and competes with the main button, so nothing stands out. Return links to the primary colour (for example --primary-700), use neutrals or the primary for icons and badges, and keep the accent for one main action per view.
Exercise
Why might you use --primary-100 instead of --primary-500 for a large background area?
Show answer
A light tint of the primary keeps the brand hue while avoiding a large field of saturated colour. This keeps the dominant 60% calm and leaves the stronger colours for structure and emphasis.