LayoutSite Footer
A site footer with a short brand note, four groups of links that wrap from four columns to two to one, and a bottom bar with a back-to-top link.
A header, a sidebar and a main area on CSS grid with a sticky header and one scrolling region; the sidebar folds behind a button on a narrow shell.
Checked on 3 December 2026 in Chrome 143.0.7499.169: 12 automated checks. What the checks are
<div class="as">
<div class="as__frame">
<header class="as__head">
<button class="as__toggle" id="as-toggle" type="button" aria-controls="as-side" aria-expanded="false">
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" focusable="false"><path d="M3 5h14M3 10h14M3 15h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
<span class="as__sr">Menu</span>
</button>
<p class="as__brand"><span class="as__logo" aria-hidden="true"></span>Workbench</p>
<form class="as__search" role="search" aria-label="Search the workspace">
<label class="as__sr" for="as-q">Search</label>
<input class="as__q" id="as-q" type="search" placeholder="Search">
</form>
</header>
<aside class="as__side" id="as-side">
<nav aria-label="Main">
<ul class="as__nav">
<li><a class="as__link" href="#as-overview" aria-current="page"><svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true" focusable="false"><rect x="3" y="3" width="6" height="6" rx="1.5" fill="currentColor"/><rect x="11" y="3" width="6" height="6" rx="1.5" fill="currentColor"/><rect x="3" y="11" width="6" height="6" rx="1.5" fill="currentColor"/><rect x="11" y="11" width="6" height="6" rx="1.5" fill="currentColor"/></svg>Overview</a></li>
<li><a class="as__link" href="#as-projects"><svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true" focusable="false"><path d="M3 6a2 2 0 0 1 2-2h3l2 2h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="currentColor"/></svg>Projects</a></li>
<li><a class="as__link" href="#as-recent"><svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="M10 6v4l3 2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>Recent</a></li>
</ul>
</nav>
<p class="as__side-note">Sample app shell. The names here are made up.</p>
</aside>
<main class="as__main" tabindex="0" aria-label="Content">
<section class="as__section" aria-labelledby="as-overview">
<h1 class="as__h1" id="as-overview">Overview</h1>
<p class="as__lede">Only this area scrolls. The header and the sidebar stay where they are.</p>
<div class="as__cards">
<article class="as__card"><h2 class="as__h2">Notes</h2><p>Short pages for ideas.</p></article>
<article class="as__card"><h2 class="as__h2">Drafts</h2><p>Work that is not ready.</p></article>
<article class="as__card"><h2 class="as__h2">Archive</h2><p>Things put away for now.</p></article>
</div>
</section>
<section class="as__section" aria-labelledby="as-projects">
<h2 class="as__h1 as__h1--sub" id="as-projects">Projects</h2>
<p class="as__lede">Three made-up projects with plain status words.</p>
<ul class="as__rows">
<li class="as__row"><span>Garden planner</span><span class="as__tag">Active</span></li>
<li class="as__row"><span>Trip notes</span><span class="as__tag as__tag--b">On hold</span></li>
<li class="as__row"><span>Recipe cards</span><span class="as__tag">Active</span></li>
</ul>
</section>
<section class="as__section" aria-labelledby="as-recent">
<h2 class="as__h1 as__h1--sub" id="as-recent">Recent</h2>
<p class="as__lede">The last things opened, newest first.</p>
<ul class="as__rows">
<li class="as__row"><span>Spring checklist</span><span class="as__tag as__tag--c">Note</span></li>
<li class="as__row"><span>Packing list</span><span class="as__tag as__tag--c">Note</span></li>
<li class="as__row"><span>Colour ideas</span><span class="as__tag as__tag--b">Draft</span></li>
<li class="as__row"><span>Reading log</span><span class="as__tag as__tag--c">Note</span></li>
</ul>
</section>
</main>
</div>
</div>.as {
--as-page: #f3f7f7;
--as-surface: #ffffff;
--as-ink: #16282c;
--as-muted: #4a6168;
--as-line: #d6e2e4;
--as-side: #0f3238;
--as-side-ink: #e8f4f5;
--as-side-muted: #a9c9cd;
--as-side-on: #1c5560;
--as-accent: #0e7a86;
--as-ring: #16282c;
--as-side-ring: #ffffff;
box-sizing: border-box;
container-type: inline-size;
height: 100vh;
height: 100dvh;
min-height: 20rem;
color: var(--as-ink);
background: var(--as-page);
font: 1rem/1.45 system-ui, system, "Segoe UI", Roboto, sans-serif;
}
.as__frame { position: relative; display: grid; grid-template: "head head" auto "side main" minmax(0, 1fr) / 14.5rem minmax(0, 1fr); height: 100%; }
.as *, .as *::before, .as *::after { box-sizing: border-box; }
.as__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.as__head { grid-area: head; position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.9rem; background: var(--as-surface); border-bottom: 1px solid var(--as-line); }
.as__toggle { display: none; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--as-ink); background: transparent; border: 1px solid var(--as-line); border-radius: 10px; cursor: pointer; }
.as__brand { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-weight: 800; letter-spacing: 0.01em; }
.as__logo { width: 1.5rem; height: 1.5rem; background: var(--as-accent); border-radius: 7px 7px 7px 2px; }
.as__search { flex: 1; display: flex; justify-content: flex-end; margin: 0; }
.as__q { width: min(100%, 16rem); min-height: 40px; padding: 0 0.8rem; font: inherit; color: var(--as-ink); background: var(--as-page); border: 1px solid var(--as-line); border-radius: 10px; }
.as__q::placeholder { color: var(--as-muted); opacity: 1; }
.as__side { grid-area: side; display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0.75rem; overflow-y: auto; color: var(--as-side-ink); background: var(--as-side); }
.as__nav { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.as__link { display: flex; align-items: center; gap: 0.65rem; min-height: 44px; padding: 0 0.8rem; font-weight: 600; color: var(--as-side-ink); text-decoration: none; border-radius: 10px; }
.as__link:hover { background: var(--as-side-on); }
.as__link[aria-current="page"] { background: var(--as-side-on); box-shadow: inset 3px 0 0 #7ee0e9; }
.as__side-note { margin: auto 0 0; padding: 0 0.5rem; font-size: 0.8rem; color: var(--as-side-muted); }
.as__main { grid-area: main; overflow: auto; padding: 1.5rem 1.5rem 2.5rem; }
.as__section + .as__section { margin-top: 1.75rem; }
.as__h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.as__h1--sub { font-size: 1.25rem; }
.as__lede { margin: 0.3rem 0 1rem; max-width: 34rem; color: var(--as-muted); }
.as__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; }
.as__card { padding: 1rem; background: var(--as-surface); border: 1px solid var(--as-line); border-radius: 14px; }
.as__card p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--as-muted); }
.as__h2 { margin: 0; font-size: 1.05rem; }
.as__rows { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.as__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; background: var(--as-surface); border: 1px solid var(--as-line); border-radius: 12px; }
.as__tag { padding: 0.15rem 0.65rem; font-size: 0.8rem; font-weight: 700; color: #0b4d29; background: #cdeedb; border-radius: 999px; }
.as__tag--b { color: #5a3300; background: #ffe3b5; }
.as__tag--c { color: #123a63; background: #d3e6fb; }
.as__toggle:focus-visible, .as__q:focus-visible, .as__main:focus-visible { outline: 3px solid var(--as-ring); outline-offset: -3px; }
.as__link:focus-visible { outline: 3px solid var(--as-side-ring); outline-offset: -3px; }
@container (max-width: 40rem) {
.as__frame { grid-template: "head" auto "side" auto "main" minmax(0, 1fr) / minmax(0, 1fr); }
.as__side { max-height: 40%; }
.as--js .as__toggle { display: grid; }
.as--js .as__side { display: none; position: absolute; top: 3.75rem; bottom: 0; left: 0; z-index: 2; width: min(17rem, 85%); max-height: none; box-shadow: 0 20px 40px -10px rgb(0 0 0 / 50%); }
.as--js.is-open .as__side { display: flex; }
.as__search { justify-content: flex-end; }
.as__main { padding: 1.1rem 1rem 2rem; }
}
@media (prefers-color-scheme: dark) {
.as {
--as-page: #0e1a1d; --as-surface: #14272b; --as-ink: #e9f3f4; --as-muted: #a9c0c5; --as-line: #274349; --as-side: #0a2328;
--as-side-on: #174852; --as-accent: #4fc4d2; --as-ring: #e9f3f4;
}
.as__tag { color: #c8f3da; background: #1c4a31; }
.as__tag--b { color: #ffe0b0; background: #5a3a0c; }
.as__tag--c { color: #cfe3fb; background: #1d3f68; }
}(function () {
'use strict';
var shell = document.querySelector('.as');
var toggle = document.getElementById('as-toggle');
var side = document.getElementById('as-side');
if (!shell || !toggle || !side) return;
// With a script, the sidebar folds on a narrow shell; without one it simply stays visible above the content.
shell.classList.add('as--js');
function setOpen(open, moveFocus) {
shell.classList.toggle('is-open', open);
toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
if (open && moveFocus) side.querySelector('a').focus();
if (!open && moveFocus) toggle.focus();
}
toggle.addEventListener('click', function () { setOpen(!shell.classList.contains('is-open'), true); });
shell.addEventListener('keydown', function (event) {
if (event.key === 'Escape' && shell.classList.contains('is-open')) setOpen(false, true);
});
Array.prototype.forEach.call(side.querySelectorAll('.as__link'), function (link) {
link.addEventListener('click', function () {
Array.prototype.forEach.call(side.querySelectorAll('.as__link'), function (other) { other.removeAttribute('aria-current'); });
link.setAttribute('aria-current', 'page');
if (shell.classList.contains('is-open')) setOpen(false, false);
});
});
})();Written by the author of the snippet. Each note has a test step or a markup check that reads the page.
LayoutA site footer with a short brand note, four groups of links that wrap from four columns to two to one, and a bottom bar with a back-to-top link.
LayoutA two-column article page whose contents list stays in view beside the text on wide screens and folds into a details block on phones.
LayoutAn accordion of five questions on details and summary, with an animated chevron and one open at a time through the name attribute.