Welcome & how this tutorial works
This tutorial is a hands-on companion to "Semantic HTML that Survives Redesigns". Instead of focusing on theory, we’ll work through concrete examples:
- Start with realistic "before" HTML (div soup, framework classes, layout hacks).
- Refactor it into semantic, resilient markup.
- Keep the original classes where possible so changes are incremental and safe.
- Use a repeatable method you can apply in your own projects.
You can follow along in:
- A throwaway
index.htmlfile. - An online playground (CodePen, JSFiddle, StackBlitz, etc.).
- Your own project (copy/paste the examples into a sandbox branch).
Each lesson includes:
- Before → After examples.
- Explanations of why the refactor improves semantics and resilience.
- A quick check question to reinforce the idea.
- Occasional “interactive challenge” prompts you can try yourself.
You don't need to be perfect. The goal is to train your eye to spot:
"This is layout-driven/framework-shaped HTML" versus "This is semantic, framework-agnostic HTML".
Key terms we’ll use
- Custom property – the underlying CSS feature (e.g.
--color-bg). - Design token – a named value used across a design system.
- Global token – a token defined in
:rootfor site-wide use. - Component token – a token scoped to a component (e.g.
.button).