asw/site/content/docs/core/reset.md
Ludo dd810f5a63
feat: auto-generated docs sidebar, Decap CMS, content migration infra
Docs restructure:
- Move flat docs into section subdirs (getting-started/, core/,
  components/, reference/) with _index.md for each
- Sidebar auto-generates from content structure — no manual menu entries
- New doc pages appear automatically when created in a section

Decap CMS:
- admin/index.html + config.yml for browser-based editing
- Local mode (npx decap-server) — no OAuth needed
- Collections for all content types: docs, articles, essays, notes, pages

Hugo head.html updated for new CSS layer filenames.
decap-server added as devDependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 18:02:34 +02:00

3.3 KiB

title description type weight date tags ai-disclosure ai-model ai-provider
Reset What ASW's reset layer does, where it came from, and what it deliberately leaves alone. docs 60 2026-04-09
reset
css
reference
generated claude-sonnet-4-5 Anthropic

ASW's reset is in src/layers/00-reset.css, ported from Pico CSS v2.1.1 (MIT). It's an opinionated normalize, not a zero-baseline reset — it corrects browser inconsistencies without stripping all defaults.


What it does

Box-sizing

Every element uses border-box. Padding and border are included in the declared width.

*, *::before, *::after {
  box-sizing: border-box;
  background-repeat: no-repeat;
}

background-repeat: no-repeat prevents accidental tiling on elements that receive a background image.

Document baseline

:where(:root) {
  -webkit-tap-highlight-color: transparent;  /* remove tap flash on mobile */
  text-size-adjust: 100%;                    /* prevent font inflation on mobile */
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;                 /* wrap long URLs / tokens */
  tab-size: 4;
}

Font size

html { font-size: 100%; }

Root font size is 100% of the browser default (typically 16px). Responsive scaling is applied in 01-tokens.css via clamp(). Setting 100% here respects user accessibility preferences — users who set a larger browser font get a proportionally larger site.

Body

body {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: var(--text-base);
  font-family: var(--font-ui);
  background-color: var(--surface);
  color: var(--text);
}

All visual values come from ASW tokens. Font and colour are set once here and inherited everywhere.

Main

main { display: block; }

Fixes a legacy IE bug where <main> wasn't treated as a block element. Still included for completeness.

Nested lists

:where(dl, ol, ul) :where(dl, ol, ul) { margin: 0; }

Removes the double margin that browsers add to nested lists.


What it leaves alone

The reset deliberately does not:

  • Zero out heading sizes or margins (those are handled by 02-semantic.css)
  • Remove list styles (lists get list-style: square in the semantic layer)
  • Reset form element appearance (handled by 03-components.css)
  • Set line-height on body (set via var(--leading) in 08-layout.css)

Pseudo-elements

::before, ::after {
  text-decoration: inherit;
  vertical-align: inherit;
}

Pseudo-elements inherit text decoration and vertical alignment from their parent. This prevents ::before/::after content from appearing unexpectedly underlined in links.


Customising the reset

The reset layer uses low-specificity :where() selectors where possible. Override anything with a standard selector — no !important needed.

/* Override: use rem-based font scaling instead of responsive clamp */
html { font-size: 1rem; }

/* Override: add body padding for a specific layout */
body { padding-inline: var(--space-4); }

  • Semantic HTML — element styles built on top of this reset
  • Token System — the custom properties (--surface, --text, --font-ui) referenced in this layer