IntermediateLesson 10 of 127 min read

Capstone: The Still Water Yoga Design System, Built and Audited

Bring the whole course together: generate the stylesheet of the studio's home page from tokens for colour, type, space, grid and motion, then audit it automatically for contrast, spacing, type scale, line length, touch targets and reduced motion, and re-check every result independently.

In this lesson you will

  • Combine colour, type, space, layout and motion
  • Generate a stylesheet from tokens
  • Audit six design rules automatically
  • Verify the audit independently

About 28 minutes

The design, checked

Lina’s final deliverable for Still Water Yoga is not a picture of a page but a small design system and the CSS made from it. It uses what the course taught. The palette comes from the base hue of lesson 4. The type scale is the 1.25 ratio of lesson 3, with body text at 16 pixels, and a reading column limited to a comfortable line length. Spacing comes from the 4 and 8 pixel scale of lesson 5, the layout is the 12-column grid of lesson 2, controls are at least 44 pixels high for thumbs, as lesson 7 required, and motion uses the easing of lesson 11 with a reduced-motion rule. The generator writes the stylesheet from tokens, so a change of the base colour is a one-line edit, as lesson 10 showed.

The point of the capstone is the audit. Six checks run on the generated CSS text: every text and background pair must reach 4.5 to 1, every margin, padding and gap must be on the spacing scale, every font size must be a step of the type scale, the reading column must hold 45 to 75 average characters, every control must be at least 44 pixels high, and the stylesheet must contain a reduced-motion rule. A design that passes these is not guaranteed to be good, but one that fails is certainly not finished.

const T = {
  color: { water: '#2a6b78', mist: '#eaf3f5', deep: '#0f2a30', accent: '#a8472f', white: '#ffffff' },
  space: [4, 8, 12, 16, 24, 32, 48, 64],
  type: [0.8, 1, 1.25, 1.5625, 1.953125, 2.44140625].map(r => 16 * r),
  chPerAvg: 1.2354,
};
const css = `:root { --text: ${T.color.deep}; --bg: ${T.color.mist}; --link: ${T.color.water}; --action: ${T.color.accent}; --action-text: ${T.color.white}; --ease-out: cubic-bezier(0, 0, 0.58, 1); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; }
h1 { font-size: 39px; margin: 0 0 16px; }
h2 { font-size: 31.25px; margin: 48px 0 16px; }
h3 { font-size: 25px; margin: 32px 0 8px; }
.lead { font-size: 20px; max-width: 54ch; }
.small { font-size: 12.8px; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(12, 1fr); }
.card { padding: 24px; border-radius: 8px; background: #ffffff; }
.button { min-height: 44px; padding: 12px 24px; color: var(--action-text); background: var(--action); transition: transform 200ms var(--ease-out); }
a { color: var(--link); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }`;
const vars = Object.fromEntries([...css.matchAll(/--([\w-]+):\s*([^;]+);/g)].map(m => [m[1], m[2]]));
const lum = hex => { const c = [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16) / 255).map(x => x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4)); return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; };
const ratio = (a, b) => { const [x, y] = [lum(a), lum(b)].sort((p, q) => q - p); return (x + 0.05) / (y + 0.05); };
const results = [];
const pairs = [['text', 'bg'], ['link', 'bg'], ['action-text', 'action']];
results.push({ check: 'contrast >= 4.5', ok: pairs.every(([f, b]) => ratio(vars[f], vars[b]) >= 4.5), detail: pairs.map(([f, b]) => ratio(vars[f], vars[b]).toFixed(2)).join(', ') });
const spacing = [...css.matchAll(/(?:margin|padding|gap)[a-z-]*:\s*([^;]+);/g)].flatMap(m => m[1].trim().split(/\s+/)).map(parseFloat).filter(x => !Number.isNaN(x));
results.push({ check: 'spacing on scale', ok: spacing.every(x => x === 0 || T.space.includes(x)), detail: spacing.length + ' values' });
const sizes = [...css.matchAll(/font-size:\s*([\d.]+)px/g)].map(m => Number(m[1]));
results.push({ check: 'font sizes on scale', ok: sizes.every(s => T.type.some(t => Math.abs(t - s) < 0.5)), detail: sizes.join(', ') });
const ch = Number(css.match(/max-width:\s*([\d.]+)ch/)[1]);
results.push({ check: 'line length 45-75', ok: ch * T.chPerAvg >= 45 && ch * T.chPerAvg <= 75, detail: (ch * T.chPerAvg).toFixed(1) + ' characters' });
const minH = Number(css.match(/min-height:\s*(\d+)px/)[1]);
results.push({ check: 'touch target >= 44', ok: minH >= 44, detail: minH + 'px' });
results.push({ check: 'reduced motion rule', ok: /prefers-reduced-motion:\s*reduce/.test(css), detail: 'present' });
results.forEach(r => console.log((r.ok ? 'PASS' : 'FAIL'), r.check.padEnd(22), r.detail));
console.log('DATA ' + JSON.stringify({ results, css, spacing, sizes }));
PASS contrast >= 4.5        13.37, 5.37, 5.82
PASS spacing on scale       17 values
PASS font sizes on scale    16, 39, 31.25, 25, 20, 12.8
PASS line length 45-75      66.7 characters
PASS touch target >= 44     44px
PASS reduced motion rule    present
:root { --text: #0f2a30; --bg: #eaf3f5; --link: #2a6b78; --action: #a8472f; --action-text: #ffffff; --ease-out: cubic-bezier(0, 0, 0.58, 1); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; }
h1 { font-size: 39px; margin: 0 0 16px; }
h2 { font-size: 31.25px; margin: 48px 0 16px; }
h3 { font-size: 25px; margin: 32px 0 8px; }
.lead { font-size: 20px; max-width: 54ch; }
.small { font-size: 12.8px; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(12, 1fr); }
.card { padding: 24px; border-radius: 8px; background: #ffffff; }
.button { min-height: 44px; padding: 12px 24px; color: var(--action-text); background: var(--action); transition: transform 200ms var(--ease-out); }
a { color: var(--link); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

The generator produced the stylesheet shown above from a small set of tokens, and the audit then read the stylesheet as plain text, exactly as a continuous integration job would. All six checks passed: contrast >= 4.5: 13.37, 5.37, 5.82; spacing on scale: 17 values; font sizes on scale: 16, 39, 31.25, 25, 20, 12.8; line length 45-75: 66.7 characters; touch target >= 44: 44px; reduced motion rule: present. The three contrast pairs are text on the light background, links on the light background, and white on the accent colour of the booking button, and all exceed 4.5 to 1. All 17 spacing values are on the scale. The font sizes, 16, 39, 31.25, 25, 20, 12.8 pixels, are steps of the 1.25 scale from 12.8 to 39.06, rounded to whole pixels for the headings. The reading column of 54ch holds about 66.7 average characters, inside the comfortable range, because the zero is about 1.24 times wider than an average character, as lesson 3 measured.

Independent check: a Python script audited the same generated text with its own regular expressions and its own implementation of each rule. It recomputed the contrast ratios, 13.37, 5.37 and 5.82, checked every spacing value against the scale, compared each font size with exact fractions of the 1.25 scale, and measured the real font file to confirm the ratio of 1.2354 between the width of a zero and an average character, which gives 66.6 characters for the 54ch column. It also confirmed the minimum control height of 44 pixels and the presence of the reduced-motion rule. Everything agrees with the Node.js audit.

What the audit does not check is as important as what it does. It cannot tell whether the photographs are good, whether the words are clear, whether the hierarchy guides the eye, or whether real people can book a class without help. For those, Lina returns to the beginning of the course: the brief, the five-second test with enough participants, the squint test, a tree test of the navigation and an A/B test of the booking button with a sample size fixed in advance. The automated checks free her time for that work, by catching the mistakes that a machine can catch.

Check by hand with the first pair: the text colour is the very dark #0f2a30 on the very light #eaf3f5, the highest-contrast pair, well above 10 to 1. The size 39 pixels comes from multiplying 16 by 1.25 four times, 39.06, rounded to 39, and 31.25 is 16 x 1.25 cubed.

Where to go next

  • Study the interface and visual design work you admire, and take it apart with the tools of this course: grid, scale, palette, spacing.
  • Learn Figma or another design tool, and connect its styles to tokens.
  • Do the Front-end development course to turn designs into working pages, and the Hosting and servers course to publish them.
  • Read the WCAG guidelines and the Material and Apple human interface guidelines.
  • Build a portfolio of two or three complete projects, each with a brief, evidence of testing and the final result.
A passing audit is not a good design

The checks find measurable mistakes. They cannot judge usefulness, clarity or taste, and a perfectly consistent design can still fail its users. Always test with people.

Run the audit on every change

Keep the generator and the audit in your project, and run them whenever a token or a style changes. A check that runs every time catches the regressions that nobody notices in review.

About this course

Every calculation in this lesson was run while the course was written, in JavaScript (Node.js 22) and checked independently in Python 3.13 (and, where it says so, with simulations or real files). Design guidelines are rules of thumb and tools change, so check current documentation, and test your own designs with real people. You have now completed the Web design course.

Practice

Change the accent colour to a lighter one and see the audit fail on the button text. Add a seventh check, for example that the focus outline is visible, and test it. Redesign the tokens for a dark theme and run the audit on the generated stylesheet.

Check what you learned

Five quick questions. Pick an answer and you will see straight away whether it is right and why.

Why generate the stylesheet from tokens?

  1. A change is made once and the audit runs on the result
  2. CSS is slower to write
  3. Browsers require it
  4. It removes colours

One source of truth.

Which rule does the 54ch column check?

  1. Contrast
  2. Touch targets
  3. Colour blindness
  4. Line length of 45 to 75 characters

ch is wider than an average character.

What does the audit not check?

  1. Contrast
  2. Spacing
  3. Reduced motion
  4. Whether the design is useful and clear to real people

Test with people.

Why audit the generated CSS text rather than the tokens?

  1. Tokens cannot be read
  2. It is shorter
  3. It checks what the browser will actually receive
  4. It is required

Test the output.

Why re-audit in Python?

  1. To make it slower
  2. To translate CSS
  3. An independent implementation finds mistakes in the first
  4. It is a rule

Two programs, one answer.

Summary

  • A design system turns decisions into tokens and tokens into stylesheets.
  • Audit contrast, spacing, type, line length, touch targets and motion automatically.
  • Machines catch mistakes; only people judge usefulness.
  • Verify the audit independently, and test with real users.

Next lesson

You have finished the Web design course.

Questions

Can I use this system for another client?

Yes. Change the tokens and the brief, keep the audit, and add the checks that the new client needs. The structure is reusable.

How do I show this work in a portfolio?

Show the brief, the decisions and the evidence for each, the tokens, the final design and the test results. Hiring managers value reasoning as much as visuals.

What should I learn next?

Interaction design and prototyping, accessibility in depth, design research methods and one design tool. Combine them with the front-end skills to ship what you design.

Progress is saved in this browser.