Kit
The parts every homepage needs, done right once.
14 parts in plain HTML and one stylesheet: a header with a real mobile menu, four kinds of hero, features, steps, facts, FAQ, a form with all its states, a closing call to action and a footer. Copy them, then change the tokens.
Live demo.
The parts assembled into one page with neutral demo text. Open it on its own to resize it or try it with the keyboard.
What every part keeps.
- Tested clean at 320, 390, 768 and 1440 px wide and at 200% text: nothing overflows, nothing is cut off, no text is clamped.
- Type sizes in rem, stepped down with media queries rather than scaled with the viewport, so zoom always works.
- Grid tracks use
min()and flex rows wrap, so a long word never pushes a column wider than the screen. - Touch targets of at least 44 px, a visible focus ring, and motion that stops for people who ask for reduced motion.
- Works without JavaScript first: the menu is a wrapping list until the script turns it into a Menu button under 48em.
- Every colour, size and font is a token, so a project restyles the kit by loading its own tokens after it. The rules come from the checklist.
Skip link
first element in body. In the demo page. Text in [brackets] is a slot for real copy.
<a class="k-skip" href="#main">Skip to content</a>Header with a real mobile menu
no-JS: the nav wraps; with kit.js: a Menu button under 48em. In the demo page. Text in [brackets] is a slot for real copy.
<header class="k-header">
<div class="k-container k-header__bar">
<a class="k-logo" href="/">[Brand]</a>
<button class="k-menu-btn" type="button" aria-expanded="false" aria-controls="k-nav" hidden>Menu</button>
<nav class="k-nav" id="k-nav" aria-label="Main">
<ul>
<li><a href="#[section-1]">[Link one]</a></li>
<li><a href="#[section-2]">[Link two]</a></li>
<li><a href="#[section-3]">[Link three]</a></li>
<li><a class="k-btn" href="#[action]">[Primary action]</a></li>
</ul>
</nav>
</div>
</header>Hero: text beside a media or object slot
In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-hero k-hero--split" aria-labelledby="hero-title">
<div class="k-container">
<div>
<h1 id="hero-title">[Headline that names the offer]</h1>
<p class="k-lead">[One sentence: what it is and why it differs]</p>
<div class="k-actions"><a class="k-btn" href="#[action]">[Primary action]</a><a class="k-btn k-btn--ghost" href="#[more]">[Secondary action]</a></div>
</div>
<figure class="k-media"><figcaption>[Lead object: a graphic made in code, a product view or a photograph]</figcaption></figure>
</div>
</section>Hero: oversized type as the image
An alternative; swap it in for its counterpart. Text in [brackets] is a slot for real copy.
<section class="k-hero k-hero--type" aria-labelledby="hero-title">
<div class="k-container">
<h1 id="hero-title">[Short headline set very large]</h1>
<p class="k-lead">[One sentence: what it is and why it differs]</p>
<div class="k-actions"><a class="k-btn" href="#[action]">[Primary action]</a></div>
</div>
</section>Hero: headline over one wide lead object
An alternative; swap it in for its counterpart. Text in [brackets] is a slot for real copy.
<section class="k-hero k-hero--object" aria-labelledby="hero-title">
<div class="k-container">
<h1 id="hero-title">[Headline that names the offer]</h1>
<p class="k-lead">[One sentence: what it is and why it differs]</p>
<div class="k-actions"><a class="k-btn" href="#[action]">[Primary action]</a></div>
<figure class="k-media k-media--wide k-object"><figcaption>[Lead object, full width]</figcaption></figure>
</div>
</section>Hero: a full-bleed backdrop (code-made SVG, image or video) behind the text, which sits on a scrim so contrast holds
An alternative; swap it in for its counterpart. Text in [brackets] is a slot for real copy.
<section class="k-hero k-hero--bleed" aria-labelledby="hero-title">
<div class="k-backdrop" aria-hidden="true">[Backdrop: an SVG or image filling the section]</div>
<div class="k-container">
<div class="k-scrim">
<h1 id="hero-title">[Headline that names the offer]</h1>
<p class="k-lead">[One sentence: what it is and why it differs]</p>
<div class="k-actions"><a class="k-btn" href="#[action]">[Primary action]</a></div>
</div>
</div>
</section>Hero action as a field and a button in one row (search, date, postcode), wrapping at 320 px and 200% text
An alternative; swap it in for its counterpart. Text in [brackets] is a slot for real copy.
<form class="k-inline-form" action="#[action]" role="search">
<label class="k-visually-hidden" for="hero-field">[What the field asks for]</label>
<input class="k-input" id="hero-field" name="q" type="text" placeholder="[Example answer]" autocomplete="off">
<button class="k-btn" type="submit">[Primary action]</button>
</form>Section: features or services as a labelled list
In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section" id="[section-1]" aria-labelledby="features-title">
<div class="k-container">
<h2 id="features-title">[What you get]</h2>
<ul class="k-grid">
<li><h3>[Feature one]</h3><p>[One or two plain sentences.]</p></li>
<li><h3>[Feature two]</h3><p>[One or two plain sentences.]</p></li>
<li><h3>[Feature three]</h3><p>[One or two plain sentences.]</p></li>
</ul>
</div>
</section>Section: how it works, numbered steps
In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section k-section--surface" id="[section-2]" aria-labelledby="steps-title">
<div class="k-container">
<h2 id="steps-title">[How it works]</h2>
<ol class="k-steps">
<li><div><h3>[Step one]</h3><p>[What happens.]</p></div></li>
<li><div><h3>[Step two]</h3><p>[What happens.]</p></div></li>
<li><div><h3>[Step three]</h3><p>[What happens.]</p></div></li>
</ol>
</div>
</section>Section: real numbers
mark unconfirmed ones .assumed; never invent. In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section" aria-labelledby="facts-title">
<div class="k-container">
<h2 id="facts-title">[In numbers]</h2>
<dl class="k-facts">
<div><dt>[what the number counts]</dt><dd>[12]</dd></div>
<div><dt>[what the number counts]</dt><dd>[340]</dd></div>
<div><dt>[what the number counts]</dt><dd>[5]</dd></div>
</dl>
</div>
</section>Section: questions as disclosures
In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section" id="[section-3]" aria-labelledby="faq-title">
<div class="k-container k-split">
<h2 id="faq-title">[Questions]</h2>
<div class="k-faq">
<details><summary>[Question one?]</summary><div><p>[Answer.]</p></div></details>
<details><summary>[Question two?]</summary><div><p>[Answer.]</p></div></details>
</div>
</div>
</section>Form with label, hint, error and success states
data-no-backend: says nothing was sent. In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section k-section--surface" id="[action]" aria-labelledby="form-title">
<div class="k-container k-split">
<div><h2 id="form-title">[Ask us]</h2><p>[One line on what happens after they send it.]</p></div>
<form class="k-form" action="#" method="post" data-no-backend>
<div class="k-field">
<label for="f-name">[Your name]</label>
<input class="k-input" id="f-name" name="name" type="text" autocomplete="name" required aria-describedby="f-name-error" data-error="[Enter your name]">
<p class="k-error" id="f-name-error"></p>
</div>
<div class="k-field">
<label for="f-email">[Email address]</label>
<p class="k-hint" id="f-email-hint">[We only use it to reply.]</p>
<input class="k-input" id="f-email" name="email" type="email" autocomplete="email" inputmode="email" required aria-describedby="f-email-hint f-email-error" data-error="[Enter an email address like [email protected]]">
<p class="k-error" id="f-email-error"></p>
</div>
<div class="k-field">
<label for="f-msg">[Message]</label>
<textarea class="k-input" id="f-msg" name="message" aria-describedby="f-msg-error"></textarea>
<p class="k-error" id="f-msg-error"></p>
</div>
<div><button class="k-btn" type="submit">[Send message]</button></div>
<p class="k-status" role="status"></p>
</form>
</div>
</section>Closing call to action band
In the demo page. Text in [brackets] is a slot for real copy.
<section class="k-section k-cta" aria-labelledby="cta-title">
<div class="k-container">
<h2 id="cta-title">[Closing line that repeats the offer]</h2>
<div class="k-actions"><a class="k-btn" href="#[action]">[Primary action]</a></div>
</div>
</section>The stylesheet.
One file, about 12 KB, with the tokens at the top. kit.css and the 2 KB kit.js for the menu and form states.
/* whata.design base kit: audited page parts that every sketch and build starts from.
Everything reads the tokens below; a project overrides them with its own tokens.css (same names) loaded after this file.
Rules kept here (do not undo them in a sketch): rem sizes stepped down by media query (no vw font sizes), grid tracks with
min(), wrapping flex rows with min-width: 0, 44 px targets, visible focus, reduced motion, no-JS first. */
:root {
/* colour roles */
--color-bg: #fbfaf7;
--color-surface: #f0eee8;
--color-text: #17150f;
--color-text-muted: #55514a;
--color-accent: #1f4fd1;
--color-accent-text: #ffffff;
--color-border: #8a857b;
--color-focus: #1f4fd1;
--color-error: #b3261e;
--color-success: #1d6b3a;
/* type */
--font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--weight-display: 700;
--step--1: 1rem;
--step-0: 1.0625rem;
--step-1: 1.3125rem;
--step-2: 1.75rem;
--step-3: 2.5rem;
--step-4: 3.75rem;
--step-5: 5.5rem;
--leading-tight: 1.05;
--leading-body: 1.55;
--measure: 66ch;
/* space and shape */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.5rem;
--space-6: 2rem;
--space-7: 3rem;
--space-8: 5rem;
--space-9: 8rem;
--container: 76rem;
--gutter: 1.5rem;
--radius: 0.5rem;
--border-width: 1px;
--duration: 200ms;
--ease: cubic-bezier(0.2, 0, 0, 1);
color-scheme: light;
}
/* dark scheme: follows the system unless the page sets data-theme="light"; data-theme="dark" forces it */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-bg: #121110; --color-surface: #1d1b19; --color-text: #f2efe9; --color-text-muted: #b9b3a8;
--color-accent: #8fb0ff; --color-accent-text: #0d1220; --color-border: #77726a; --color-focus: #8fb0ff;
--color-error: #ff8f86; --color-success: #6fd59a; color-scheme: dark;
}
}
:root[data-theme="dark"] {
--color-bg: #121110; --color-surface: #1d1b19; --color-text: #f2efe9; --color-text-muted: #b9b3a8;
--color-accent: #8fb0ff; --color-accent-text: #0d1220; --color-border: #77726a; --color-focus: #8fb0ff;
--color-error: #ff8f86; --color-success: #6fd59a; color-scheme: dark;
}
@media (max-width: 47.99em) {
:root { --step-3: 2rem; --step-4: 2.625rem; --step-5: 3.25rem; --space-8: 3.5rem; --space-9: 5rem; }
}
@media (max-width: 30em) {
:root { --step-4: 2.25rem; --step-5: 2.625rem; --gutter: 1rem; }
}
/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font: var(--step-0)/var(--leading-body) var(--font-body); overflow-wrap: anywhere; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-display); line-height: var(--leading-tight); margin: 0 0 var(--space-4); overflow-wrap: anywhere; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }
.k-container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.k-section { padding-block: var(--space-9); }
.k-section--surface { background: var(--color-surface); }
.k-eyebrow { font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.k-lead { font-size: var(--step-1); color: var(--color-text-muted); }
.k-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.k-skip { position: absolute; left: var(--space-4); top: -10rem; z-index: 10; background: var(--color-text); color: var(--color-bg); padding: var(--space-3) var(--space-4); border-radius: var(--radius); }
.k-skip:focus { top: var(--space-4); }
.assumed { border-bottom: 2px dotted currentColor; padding-bottom: 1px; }
/* buttons */
.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 2.75rem; padding: var(--space-3) var(--space-5); border-radius: var(--radius); border: var(--border-width) solid transparent; background: var(--color-accent); color: var(--color-accent-text); font: 600 var(--step-0)/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: filter var(--duration) var(--ease); }
.k-btn:hover { filter: brightness(1.08); }
.k-btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.k-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.k-actions > * { flex: 0 1 auto; min-width: 0; }
/* header: no-JS the nav wraps under the logo; with JS it folds into a Menu button under 48em */
.k-header { border-bottom: var(--border-width) solid var(--color-border); background: var(--color-bg); }
.k-header__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); min-height: 4rem; padding-block: var(--space-3); }
.k-logo { font: var(--weight-display) var(--step-1)/1.1 var(--font-display); text-decoration: none; min-width: 0; padding-block: var(--space-2); }
.k-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); }
.k-nav a:not(.k-btn) { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.k-nav a:not(.k-btn):hover, .k-nav a[aria-current="page"] { text-decoration: underline; }
.k-menu-btn { display: none; min-height: 2.75rem; min-width: 2.75rem; padding: var(--space-2) var(--space-4); border: var(--border-width) solid var(--color-border); border-radius: var(--radius); background: transparent; color: var(--color-text); font: 600 var(--step-0)/1 var(--font-body); cursor: pointer; }
@media (max-width: 47.99em) {
.k-header.k-js .k-menu-btn { display: inline-flex; align-items: center; }
.k-header.k-js .k-nav { display: none; flex-basis: 100%; }
.k-header.k-js.is-open .k-nav { display: block; padding-bottom: var(--space-3); }
.k-header.k-js .k-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
.k-header.k-js .k-nav li + li { border-top: var(--border-width) solid var(--color-border); }
.k-header.k-js .k-nav .k-btn { margin-top: var(--space-3); width: 100%; }
}
/* heroes */
.k-hero { padding-block: var(--space-8) var(--space-9); }
.k-hero--split .k-container { display: grid; gap: var(--space-7); align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.k-hero--type h1 { font-size: var(--step-5); max-width: 16ch; }
.k-hero--object { padding-bottom: var(--space-7); }
.k-hero--object .k-object { margin-top: var(--space-7); }
.k-media { margin: 0; border-radius: var(--radius); background: var(--color-surface); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--color-text-muted); }
.k-media--wide { aspect-ratio: 16 / 7; }
.k-media--auto { aspect-ratio: auto; } /* a graphic that sets its own height (a tall SVG): no clipping */
.k-hero--bleed { position: relative; isolation: isolate; color: var(--color-text); }
.k-hero--bleed .k-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.k-hero--bleed .k-backdrop > * { width: 100%; height: 100%; object-fit: cover; }
.k-hero--bleed .k-scrim { background: color-mix(in srgb, var(--color-bg) 82%, transparent); border-radius: var(--radius); padding: var(--space-6); max-width: 40rem; }
.k-media figcaption { padding: var(--space-4); font-size: var(--step--1); text-align: center; }
/* sections */
.k-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); list-style: none; margin: var(--space-6) 0 0; padding: 0; }
.k-grid > li { min-width: 0; }
.k-grid h3 { margin-bottom: var(--space-2); }
.k-steps { counter-reset: step; list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.k-steps > li { counter-increment: step; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.k-steps > li::before { content: counter(step); font: var(--weight-display) var(--step-2)/1 var(--font-display); color: var(--color-accent); min-width: 2ch; }
.k-facts { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); margin: var(--space-6) 0 0; }
.k-facts dt { order: 2; color: var(--color-text-muted); }
.k-facts div { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.k-facts dd { order: 1; margin: 0; font: var(--weight-display) var(--step-3)/1 var(--font-display); }
.k-faq { margin-top: var(--space-6); border-top: var(--border-width) solid var(--color-border); max-width: 48rem; }
.k-faq details { border-bottom: var(--border-width) solid var(--color-border); }
.k-faq summary { cursor: pointer; min-height: 2.75rem; padding-block: var(--space-4); font-weight: 600; list-style-position: outside; margin-left: 1.25rem; }
.k-faq details > div { padding-bottom: var(--space-4); }
.k-cta { background: var(--color-text); color: var(--color-bg); }
.k-cta .k-btn { background: var(--color-bg); color: var(--color-text); }
.k-cta .k-btn--ghost { background: transparent; color: var(--color-bg); border-color: var(--color-bg); }
.k-cta :focus-visible { outline-color: var(--color-bg); }
/* two columns: heading and text beside the content (forms, FAQ) */
.k-split { display: grid; gap: var(--space-6) var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); align-items: start; }
.k-split > * { min-width: 0; }
.k-split .k-form, .k-split .k-faq { margin-top: 0; }
/* form: labels above, hint under, error text and aria-invalid on submit, success in a status region */
.k-form { display: grid; gap: var(--space-5); max-width: 36rem; margin-top: var(--space-6); }
.k-field { display: grid; gap: var(--space-2); min-width: 0; }
.k-field label { font-weight: 600; }
.k-hint { color: var(--color-text-muted); font-size: var(--step--1); margin: 0; }
.k-input { width: 100%; min-width: 0; min-height: 2.75rem; padding: var(--space-3) var(--space-4); border: 2px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); color: var(--color-text); font: inherit; }
textarea.k-input { min-height: 8rem; resize: vertical; }
.k-input[aria-invalid="true"] { border-color: var(--color-error); }
.k-error { color: var(--color-error); font-weight: 600; margin: 0; }
.k-error:empty { display: none; }
.k-status:empty { display: none; }
.k-status { padding: var(--space-4); border-left: 4px solid var(--color-success); background: var(--color-surface); }
.k-inline-form { display: flex; flex-wrap: wrap; gap: var(--space-3); max-width: 36rem; }
.k-inline-form .k-input { flex: 1 1 6rem; min-width: 0; }
.k-inline-form .k-btn { flex: 0 1 auto; }
/* footer */
.k-footer { border-top: var(--border-width) solid var(--color-border); padding-block: var(--space-7); font-size: var(--step-0); }
.k-footer__cols { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); }
.k-footer ul { list-style: none; margin: 0; padding: 0; }
.k-footer li a { display: inline-flex; min-height: 2.75rem; align-items: center; }
.k-footer h2 { font-size: var(--step-0); margin-bottom: var(--space-2); }
.k-footer__small { margin-top: var(--space-6); color: var(--color-text-muted); }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
For a distinctive page, start from a section.
The kit is the sound base. The character comes from sections measured from real sites, which your agent can pull through the MCP server.