---
title: "Article"
description: "Website blocks - Article: Blocks for a single article or post, top to bottom: its header, the formatted body, share links, the author's bio and the contributors, related reading and the previous / next articles."
slug: "website-article"
---

import { DocPage, PageHeader, DocText, DocLink } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="website-article" title="Article" introStyle="max-width:42rem;">
  Blocks for a single article or post, top to bottom: its header, the formatted body, share links, the author's bio and the contributors, related reading and the previous / next articles. Every block is CSS-only and built from the library's components and tokens.
</PageHeader>

<h2 id="template" class="h2-display">The template</h2>

<DocText>The Article blocks composed into one page - the source is the page. Previous, Next and Read next are routes of <DocLink href="routing.html">defuss-dom-router</DocLink> (<code>#/articles/testing-sync</code>): <code>prepare()</code> builds the routed article from the page's data block and <code>commit()</code> swaps it in - its photo, its text, its author's bio and the two other articles to read next. The byline's name leads to the bio below; the bar and the footer lead to the sister sites. The language switch translates the frame with <DocLink href="translation.html">defuss-i18n</DocLink> - the date, the reading time and the author's role are values of the routed article; the articles stay as written.</DocText>

<div class="flex flex-wrap items-center gap-2 mb-6">
  <a class="btn" href="full-website-article.html" target="_blank" rel="noopener"><i data-lucide="maximize-2"></i> Open full screen</a>
</div>

```html example label="An article page" schema="none" hint="Previous / Next are routes (#/articles/designing-for-calm) whose prepare() builds the article; the switch translates the frame. Article Header, Share Links, Article Body, Author Bio, Article Navigation, Related Items and an Author List (stack) - the Article blocks composed into one page." previewStyle="align-items:stretch;"
<style>
  @import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,600;0,7..72,700;1,7..72,400&family=Manrope:wght@500;600;700;800&display=swap');
  /* An engineering long read: a site bar, the headline over a wide photo that leaves the text column, a 40rem column
     of Literata at reading size, a pull-quote with a hanging mark, then the author, the way on and what to read next.
     Literata for reading, Manrope for every label around it. Looks: Longform (warm white and deep blue, follows light /
     dark), Blueprint (navy, a drawing grid behind the headline, cyan) and E-ink (grey paper, black only, a grain). */
  #site-article {
    --background: oklch(0.99 0.003 85);
    --foreground: oklch(0.2 0.012 260);
    --card: oklch(0.975 0.004 85);
    --card-foreground: var(--foreground);
    --muted: oklch(0.955 0.005 85);
    --muted-foreground: oklch(0.46 0.015 260);
    --border: oklch(0.2 0.012 260 / 0.12);
    --input: oklch(0.2 0.012 260 / 0.24);
    --primary: oklch(0.47 0.13 258);
    --primary-foreground: oklch(0.99 0.003 85);
    --secondary: oklch(0.955 0.005 85);
    --secondary-foreground: var(--foreground);
    --accent: oklch(0.95 0.025 258);
    --accent-foreground: oklch(0.38 0.12 258);
    --ring: var(--primary);
    --radius: 0.5rem;
    --radius-sm: max(0px, calc(var(--radius) - 4px));
    --radius-md: max(0px, calc(var(--radius) - 2px));
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
    --article-read: 'Literata', Georgia, serif;
    --article-ui: 'Manrope', var(--font-sans);
    --article-band: transparent;
    color-scheme: light;
    container-type: inline-size;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: clip;
    padding-block-end: clamp(3rem, 7vw, 5.5rem);
    background: var(--background);
    color: var(--foreground);
    font-family: var(--article-ui);
  }
  .dark #site-article[data-look='longform'] {
    color-scheme: dark;
    --background: oklch(0.19 0.01 260);
    --foreground: oklch(0.93 0.006 85);
    --card: oklch(0.225 0.012 260);
    --muted: oklch(0.25 0.012 260);
    --muted-foreground: oklch(0.74 0.012 260);
    --border: oklch(0.93 0.006 85 / 0.12);
    --input: oklch(0.93 0.006 85 / 0.24);
    --primary: oklch(0.76 0.11 255);
    --primary-foreground: oklch(0.19 0.01 260);
    --secondary: oklch(0.25 0.012 260);
    --accent: oklch(0.28 0.04 258);
    --accent-foreground: oklch(0.86 0.08 255);
  }
  #site-article[data-look='blueprint'] {
    color-scheme: dark;
    --background: oklch(0.24 0.06 255);
    --foreground: oklch(0.96 0.012 230);
    --card: oklch(0.28 0.065 255);
    --muted: oklch(0.3 0.065 255);
    --muted-foreground: oklch(0.8 0.04 235);
    --border: oklch(0.96 0.012 230 / 0.16);
    --input: oklch(0.96 0.012 230 / 0.28);
    --primary: oklch(0.85 0.11 205);
    --primary-foreground: oklch(0.22 0.06 255);
    --secondary: oklch(0.3 0.065 255);
    --accent: oklch(0.32 0.07 240);
    --accent-foreground: oklch(0.9 0.08 205);
    --article-band: oklch(0.21 0.06 255);
  }
  #site-article[data-look='eink'] {
    color-scheme: light;
    --background: oklch(0.935 0.002 90);
    --foreground: oklch(0.16 0 0);
    --card: oklch(0.955 0.002 90);
    --muted: oklch(0.9 0.002 90);
    --muted-foreground: oklch(0.38 0 0);
    --border: oklch(0.16 0 0 / 0.16);
    --input: oklch(0.16 0 0 / 0.3);
    --primary: oklch(0.16 0 0);
    --primary-foreground: oklch(0.935 0.002 90);
    --secondary: oklch(0.9 0.002 90);
    --accent: oklch(0.88 0.002 90);
    --accent-foreground: oklch(0.16 0 0);
    --radius: 0.125rem;
  }
  #site-article .article-look-only {
    display: none;
  }
  #site-article[data-look='blueprint'] .article-look-only[data-for='blueprint'],
  #site-article[data-look='eink'] .article-look-only[data-for='eink'] {
    display: block;
  }
  #site-article [hidden] {
    display: none !important;
  }
  /* the site bar (Site Header): the publication, its sister sites, the look, the language and the mode */
  #site-article .mk-header.article-bar {
    background: transparent;
    border-block-end: 1px solid var(--border);
  }
  #site-article .article-bar .mk-header-inner {
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    width: 100%;
    max-width: none;
    min-height: 4.5rem;
    padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  }
  #site-article .article-bar .mk-header-nav {
    margin-inline-end: auto;
  }
  /* narrow: the menu button sits at the end of the brand's row, the controls wrap below */
  #site-article .article-bar .site-menu {
    margin-inline-start: auto;
  }
  #site-article .sheet .mk-header-sheet-actions {
    display: grid;
    justify-content: stretch;
  }
  #site-article .article-bar .nav-menu-list {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  #site-article .article-bar .nav-menu-link {
    color: var(--muted-foreground);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
  }
  #site-article .article-bar .nav-menu-link:hover {
    color: var(--foreground);
  }
  /* the category is a label, not a link */
  #site-article .mk-article-header-category:hover {
    text-decoration: none;
  }
  #site-article span.mk-author-list-name:hover {
    text-decoration: none;
  }
  #site-article .article-copied {
    align-self: center;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
  }
  /* the footer (Site Footer, simple): the publication, its sister sites, the small print */
  #site-article .mk-footer.article-footer {
    box-sizing: border-box;
    margin-block-start: clamp(3rem, 7vw, 5rem);
    margin-block-end: calc(-1 * clamp(3rem, 7vw, 5.5rem));
    border-block-start: 1px solid var(--border);
    background: var(--card);
  }
  #site-article .article-footer .mk-footer-inner {
    max-width: none;
    padding: 2rem clamp(1rem, 4vw, 2.5rem);
  }
  #site-article .article-footer .mk-footer-brand {
    color: var(--foreground);
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  #site-article .article-footer .mk-footer-brand span {
    color: var(--muted-foreground);
    font-weight: 600;
  }
  #site-article .article-footer .mk-footer-links a {
    color: var(--muted-foreground);
    font-weight: 600;
  }
  #site-article .article-footer .mk-footer-links a:hover {
    color: var(--foreground);
  }
  #site-article .article-brand {
    display: block;
    color: var(--foreground);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
  }
  #site-article .article-brand span {
    color: var(--muted-foreground);
    font-weight: 600;
  }
  #site-article .article-bar-controls {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 1;
    gap: 0.5rem;
    min-width: 0;
  }
  #site-article .article-bar .select {
    min-width: 8.5rem;
  }
  #site-article .article-progress {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 3px;
    margin-block-end: -3px;
    background: var(--primary);
    transform-origin: left;
    scale: 0 1;
    animation: article-progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes article-progress {
    to {
      scale: 1 1;
    }
  }
  @supports not (animation-timeline: scroll()) {
    #site-article .article-progress {
      display: none;
    }
  }
  /* the header: label, headline, standfirst, the byline - then the wide photo */
  #site-article .mk-article-header {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    align-items: stretch;
    gap: 1.25rem;
    padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem) 0;
  }
  #site-article .mk-article-header > .surface {
    inset: 0 0 auto;
    height: calc(100% - clamp(8rem, 16vw, 14rem));
    background: var(--article-band);
  }
  #site-article .article-grid {
    --surface-size: 28px;
    --surface-ink: oklch(0.85 0.08 210 / 0.09);
    --surface-bg: var(--article-band);
    mask-image: linear-gradient(#000 60%, transparent);
  }
  #site-article .article-grain {
    --surface-size: 160px;
    --surface-ink: oklch(0.16 0 0 / 0.06);
    --surface-bg: transparent;
  }
  #site-article .mk-article-header > :is(a, span, h1, p, div):not(.surface) {
    box-sizing: border-box;
    width: 100%;
    max-width: 41rem;
    margin-inline: auto;
  }
  #site-article .mk-article-header-category {
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
  }
  #site-article .mk-article-header-title {
    font: 700 clamp(2.5rem, 6vw, 4.25rem)/1.04 var(--article-read);
    letter-spacing: -0.025em;
    text-wrap: balance;
  }
  #site-article .mk-article-header-subtitle {
    margin: 0;
    color: var(--muted-foreground);
    font: 400 clamp(1.1875rem, 2vw, 1.4375rem)/1.45 var(--article-read);
    text-wrap: pretty;
  }
  #site-article .mk-article-header-byline {
    gap: 0.875rem;
    margin-block-start: 0.5rem;
    font-size: 0.875rem;
  }
  #site-article .mk-article-header-author {
    color: var(--foreground);
    font-weight: 700;
    text-decoration: none;
  }
  #site-article .mk-article-header-meta {
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
  }
  #site-article .mk-article-header-media {
    width: 100%;
    max-width: 62rem;
    margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
  }
  #site-article .mk-article-header-media img {
    aspect-ratio: 2 / 1;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
  }
  #site-article[data-look='eink'] .mk-article-header-media img {
    filter: grayscale(1) contrast(1.05);
  }
  #site-article .mk-article-header-media figcaption {
    margin-block-start: 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
  }
  /* the column */
  #site-article .article-column {
    box-sizing: border-box;
    width: 100%;
    max-width: 44rem;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 1.5rem);
  }
  #site-article .mk-share-links {
    margin-block: 2rem 0;
    padding-block-end: 1.5rem;
    border-block-end: 1px solid var(--border);
  }
  #site-article .mk-share-links-label {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  #site-article .mk-article-body {
    --_measure: 41rem;
    box-sizing: border-box;
    padding-block: 2.25rem 1rem;
    padding-inline: clamp(1rem, 4vw, 1.5rem);
    font: 400 clamp(1.0625rem, 1.5vw, 1.1875rem)/1.75 var(--article-read);
  }
  #site-article .mk-article-body h2 {
    margin-block: 2.5rem 0.75rem;
    font: 700 1.5rem/1.25 var(--article-ui);
    letter-spacing: -0.02em;
  }
  #site-article .mk-article-body a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }
  #site-article .mk-article-body > p:first-child::first-letter {
    float: left;
    margin: 0.1em 0.12em 0 0;
    font: 700 3.6em/0.8 var(--article-read);
    color: var(--foreground);
  }
  /* the pull-quote: larger, a hanging mark in the accent, a rule above and below */
  #site-article .mk-article-body > blockquote:not([class]) {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.75rem 0 1.5rem;
    border: 0;
    border-block: 1px solid var(--border);
    background: none;
    font-style: normal;
  }
  #site-article .mk-article-body > blockquote:not([class])::before {
    content: '\201C';
    position: absolute;
    top: 0.15rem;
    left: -0.05em;
    color: var(--primary);
    font: 700 4.5rem/1 var(--article-read);
  }
  #site-article .mk-article-body > blockquote:not([class]) p {
    margin: 0;
    padding-inline-start: 2.75rem;
    font: 400 italic clamp(1.375rem, 2.4vw, 1.75rem)/1.35 var(--article-read);
    letter-spacing: -0.01em;
  }
  #site-article .mk-article-body > blockquote:not([class]) cite {
    display: block;
    margin-block-start: 0.875rem;
    padding-inline-start: 2.75rem;
    color: var(--muted-foreground);
    font: 700 0.8125rem/1.3 var(--article-ui);
    font-style: normal;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  /* after the text: the author, the way on, what to read next */
  #site-article .article-after {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding-block-start: 1.5rem;
  }
  #site-article .mk-author-bio {
    gap: 1.25rem;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--card);
  }
  #site-article .mk-author-bio-label {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  #site-article .mk-author-bio-name {
    font: 700 1.25rem/1.2 var(--article-ui);
  }
  #site-article .mk-author-bio-name a {
    color: inherit;
    text-decoration: none;
  }
  #site-article .mk-author-bio-text {
    font-family: var(--article-read);
  }
  #site-article .mk-article-nav-dir {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  #site-article .mk-article-nav-title {
    font: 600 1.0625rem/1.3 var(--article-read);
  }
  #site-article .article-next {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  #site-article .article-next h2 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  #site-article .article-next-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: 1.5rem;
  }
  #site-article .mk-related-item-title {
    font: 600 1.0625rem/1.3 var(--article-read);
  }
  #site-article .mk-related-item-title a {
    color: inherit;
  }
  #site-article[data-look='eink'] .mk-related-item-media img {
    filter: grayscale(1);
  }
  #site-article .mk-author-list-title {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  @media (prefers-reduced-motion: reduce) {
    #site-article .article-progress {
      animation: none;
      display: none;
    }
  }
  /* light or dark: the Swap writes the page's dark class - every look has a light and a dark palette */
  #site-article .site-mode {
    flex: none;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--foreground);
  }
  #site-article .site-mode:hover {
    background: var(--accent);
    color: var(--accent-foreground);
  }
  /* -- modes: each look in light and dark, derived from the palettes above (the other mode of each look) -- */
  :root:not(.dark) #site-article[data-look='longform'] {
    --accent: oklch(0.945 0.025 258);
    --accent-foreground: oklch(0.2 0.012 260);
  }
  .dark #site-article[data-look='longform'] {
    --accent-foreground: oklch(0.93 0.006 85);
  }
  .dark #site-article[data-look='blueprint'] {
    --accent: oklch(0.33 0.05 240);
    --accent-foreground: oklch(0.96 0.012 230);
  }
  :root:not(.dark) #site-article[data-look='blueprint'] {
    color-scheme: light;
    --background: oklch(0.985 0.025 255);
    --foreground: oklch(0.2 0.012 230);
    --card: oklch(0.997 0.025 255);
    --card-foreground: oklch(0.2 0.012 230);
    --muted: oklch(0.95 0.025 255);
    --muted-foreground: oklch(0.46 0.03 235);
    --border: oklch(0.2 0.012 230 / 0.12);
    --input: oklch(0.2 0.012 230 / 0.12);
    --primary: oklch(0.58 0.11 205);
    --primary-foreground: oklch(0.17 0.03 205);
    --secondary: oklch(0.955 0.025 255);
    --secondary-foreground: oklch(0.25 0.012 230);
    --accent: oklch(0.94 0.025 240);
    --accent-foreground: oklch(0.2 0.012 230);
    --ring: oklch(0.58 0.11 205);
    --article-band: oklch(0.956 0.03 255);
    --popover: oklch(0.997 0 0);
    --popover-foreground: oklch(0.2 0 0);
  }
  :root:not(.dark) #site-article[data-look='eink'] {
    --accent: oklch(0.89 0.002 90);
  }
  .dark #site-article[data-look='eink'] {
    color-scheme: dark;
    --background: oklch(0.17 0.002 90);
    --foreground: oklch(0.94 0 0);
    --card: oklch(0.205 0.002 90);
    --card-foreground: oklch(0.94 0 0);
    --muted: oklch(0.24 0.002 90);
    --muted-foreground: oklch(0.74 0 0);
    --border: oklch(0.95 0 0 / 0.14);
    --input: oklch(0.95 0 0 / 0.14);
    --primary: oklch(0.93 0 0);
    --primary-foreground: oklch(0.17 0 0);
    --secondary: oklch(0.25 0.002 90);
    --secondary-foreground: oklch(0.9 0 0);
    --accent: oklch(0.26 0.002 90);
    --accent-foreground: oklch(0.94 0 0);
    --ring: oklch(0.93 0 0);
    --article-band: oklch(0.97 0 0 / 0);
    --popover: oklch(0.215 0 0);
    --popover-foreground: oklch(0.94 0 0);
  }
  /* -- modes: end -- */
</style>
<article id="site-article" data-look="longform" data-i18n-component>
  <header class="mk-header article-bar">
    <div class="mk-header-inner">
      <a class="mk-header-brand article-brand" href="#/" data-router-link>Acme <span>Engineering</span></a>
      <button
        type="button"
        class="btn mk-header-menu site-menu"
        data-variant="ghost"
        data-size="icon"
        data-sheet-trigger="article-menu"
        aria-haspopup="dialog"
        aria-label="Open menu"
        data-i18n-aria-label-en="Open menu"
        data-i18n-aria-label-de="Menü öffnen"
        ><svg
          viewBox="0 0 24 24"
          width="20"
          height="20"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          aria-hidden="true"
        >
          <path d="M4 6h16M4 12h16M4 18h16" /></svg
      ></button>
      <nav
        class="mk-header-nav"
        aria-label="More from Acme"
        data-i18n-aria-label-en="More from Acme"
        data-i18n-aria-label-de="Mehr von Acme"
      >
        <ul class="nav-menu-list">
          <li class="nav-menu-item"><a class="nav-menu-link" href="full-website-blog.html">Journal</a></li>
          <li class="nav-menu-item"
            ><a class="nav-menu-link" href="full-website-news.html" data-i18n-target="nav-news">Newsroom</a></li
          >
        </ul>
      </nav>
      <div class="mk-header-actions article-bar-controls">
        <select
          class="select"
          data-size="sm"
          data-site-look
          aria-label="Look"
          data-i18n-aria-label-en="Look"
          data-i18n-aria-label-de="Stil"
          style="width: auto"
        >
          <option value="longform" data-i18n-target="look-longform">Longform</option>
          <option value="blueprint" data-i18n-target="look-blueprint">Blueprint</option>
          <option value="eink" data-i18n-target="look-eink">E-ink</option>
        </select>
        <div
          class="language-switcher"
          data-app-locale
          role="group"
          aria-label="Language"
          data-i18n-aria-label-en="Language"
          data-i18n-aria-label-de="Sprache"
          data-languages="en de"
          data-value="en"
          data-size="sm"
          data-variant="swap"
          data-display="icon"
          data-flag-shape="circle"
        ></div>
        <label class="swap site-mode" data-variant="rotate" data-size="sm">
          <input
            type="checkbox"
            data-site-mode
            aria-label="Dark mode"
            data-i18n-aria-label-en="Dark mode"
            data-i18n-aria-label-de="Dunkler Modus"
          />
          <span class="swap-on" aria-hidden="true"><i data-lucide="moon"></i></span>
          <span class="swap-off" aria-hidden="true"><i data-lucide="sun"></i></span>
        </label>
      </div>
    </div>
    <!-- narrow: the navigation in a Sheet behind the menu button -->
    <dialog
      id="article-menu"
      class="sheet"
      data-side="right"
      role="dialog"
      aria-modal="true"
      aria-labelledby="article-menu-title"
    >
      <div class="sheet-content">
        <div class="sheet-header">
          <h2 class="sheet-title" id="article-menu-title">Acme Engineering</h2>
        </div>
        <div class="sheet-body">
          <ul class="mk-header-sheet-nav">
            <li><a href="full-website-blog.html">Journal</a></li>
            <li><a href="full-website-news.html" data-i18n-target="sh-news">Newsroom</a></li>
            <li><a href="full-website-comments.html" data-i18n-target="sh-comments">Reader discussions</a></li>
            <li><a href="mailto:engineering@acme.example" data-i18n-target="sh-write">Write to the editors</a></li>
          </ul>
        </div>
      </div>
      <button
        type="button"
        class="sheet-close-x"
        data-sheet-close
        aria-label="Close"
        data-i18n-aria-label-en="Close"
        data-i18n-aria-label-de="Schließen"
        ><svg
          width="15"
          height="15"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          aria-hidden="true"
        >
          <path d="M18 6 6 18M6 6l12 12" /></svg
      ></button>
    </dialog>
  </header>
  <div class="article-progress" aria-hidden="true"></div>
  <header class="mk-article-header">
    <div
      class="surface article-grid article-look-only"
      data-for="blueprint"
      data-variant="background"
      data-pattern="grid"
      aria-hidden="true"
    ></div>
    <div
      class="surface article-grain article-look-only"
      data-for="eink"
      data-variant="background"
      data-pattern="grain"
      aria-hidden="true"
    ></div>
    <span class="mk-article-header-category">Engineering</span>
    <h1 class="mk-article-header-title">How offline sync works in Acme 4.0</h1>
    <p class="mk-article-header-subtitle">CRDTs, a write-ahead log and a lot of patience.</p>
    <div class="mk-article-header-byline">
      <span class="avatar"><img class="avatar-image" src="images/avatars/47-96.webp" alt="" data-article-face /></span>
      <div>
        <a class="mk-article-header-author" href="#article-bio">Sophie Tan</a>
        <div class="mk-article-header-meta"
          ><time datetime="2026-10-01" data-article-date
            ><span data-i18n-target="date"><span data-i18n-value="date">1 October 2026</span></span></time
          ><span data-i18n-target="read"><span data-i18n-value="minutes">8</span> min read</span></div
        >
      </div>
    </div>
    <figure class="mk-article-header-media">
      <img
        src="images/photos/60-1400x700.webp"
        alt="A desk with a keyboard, a tablet and a notebook"
        data-article-photo
      />
      <figcaption data-article-caption>The first sketch of the sync pipeline, March 2026.</figcaption>
    </figure>
  </header>
  <div class="article-column">
    <div
      class="mk-share-links"
      role="group"
      aria-label="Share this article"
      data-i18n-aria-label-en="Share this article"
      data-i18n-aria-label-de="Diesen Artikel teilen"
    >
      <span class="mk-share-links-label" data-i18n-target="share">Share</span>
      <ul class="mk-share-links-list">
        <li
          ><a
            class="btn"
            data-variant="outline"
            data-size="icon-sm"
            href="https://x.com/intent/post?url=https%3A%2F%2Fexample.com%2Fcalm-software&amp;text=Calm%20software"
            target="_blank"
            rel="noopener"
            aria-label="Share on X"
            data-i18n-aria-label-en="Share on X"
            data-i18n-aria-label-de="Auf X teilen"
            ><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true">
              <path
                d="M18.9 2H22l-6.8 7.8L23.2 22h-6.3l-4.9-6.4L6.4 22H3.3l7.3-8.3L.8 2h6.4l4.4 5.9L18.9 2Zm-1.1 18h1.7L6.3 3.9H4.5L17.8 20Z"
              /></svg></a
        ></li>
        <li
          ><a
            class="btn"
            data-variant="outline"
            data-size="icon-sm"
            href="https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fexample.com%2Fcalm-software"
            target="_blank"
            rel="noopener"
            aria-label="Share on LinkedIn"
            data-i18n-aria-label-en="Share on LinkedIn"
            data-i18n-aria-label-de="Auf LinkedIn teilen"
            ><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true">
              <path
                d="M5 3.5A2.5 2.5 0 1 1 5 8.5 2.5 2.5 0 0 1 5 3.5ZM3 10h4v11H3V10Zm7 0h3.8v1.6h.1c.5-1 1.8-1.9 3.6-1.9 3.9 0 4.5 2.5 4.5 5.8V21h-4v-4.9c0-1.2 0-2.7-1.7-2.7s-2 1.3-2 2.6v5h-4V10Z"
              /></svg></a
        ></li>
        <li
          ><a
            class="btn"
            data-variant="outline"
            data-size="icon-sm"
            href="mailto:?subject=Calm%20software&amp;body=https%3A%2F%2Fexample.com%2Fcalm-software"
            aria-label="Share by email"
            data-i18n-aria-label-en="Share by email"
            data-i18n-aria-label-de="Per E-Mail teilen"
            ><i data-lucide="mail"></i></a
        ></li>
        <li
          ><button
            type="button"
            class="btn"
            data-variant="outline"
            data-size="icon-sm"
            data-share="copy"
            aria-label="Copy link"
            data-i18n-aria-label-en="Copy link"
            data-i18n-aria-label-de="Link kopieren"
            ><i data-lucide="link"></i></button
        ></li>
      </ul>
      <span class="article-copied" role="status" data-article-copied hidden
        ><span data-i18n-target="copied">Link copied</span></span
      >
    </div>
  </div>
  <div class="mk-article-body" data-article-body>
    <p
      >Sync is the feature nobody notices until it fails. Our goal for 4.0 was simple to state and hard to build:
      <strong>never lose a keystroke</strong>, online or off.</p
    >
    <h2>Why CRDTs</h2>
    <p
      >A conflict-free replicated data type lets two devices edit the same document without a server deciding who wins.
      Every operation
      <a href="https://en.wikipedia.org/wiki/Commutative_property" target="_blank" rel="noopener">commutes</a> - merging
      becomes a set union.</p
    >
    <blockquote><p>The best sync is the one you forget is there.</p><cite>Hannah Lee, Design</cite></blockquote>
  </div>
  <div class="article-column article-after">
    <section class="mk-author-bio" aria-labelledby="article-bio">
      <span class="avatar" data-size="lg"
        ><img class="avatar-image" src="images/avatars/47-160.webp" alt="" data-article-bio-face
      /></span>
      <div class="mk-author-bio-body">
        <span class="mk-author-bio-label" data-i18n-target="written">Written by</span>
        <h2 class="mk-author-bio-name" id="article-bio" data-article-bio-name>Sophie Tan</h2>
        <p class="mk-author-bio-role" data-i18n-target="bio-role"
          ><span data-i18n-value="role">Staff engineer, Sync team</span></p
        >
        <p class="mk-author-bio-text" data-article-bio-text
          >Sophie leads the sync team at Acme. Before that she built storage engines at two databases you have heard of.
          She writes about distributed systems, testing, and calm engineering.</p
        >
        <ul class="mk-author-bio-links">
          <li
            ><a
              class="btn"
              data-variant="ghost"
              data-size="icon-sm"
              href="mailto:sophie@acme.example"
              aria-label="Write to the author"
              data-i18n-aria-label-en="Write to the author"
              data-i18n-aria-label-de="Der Autorin schreiben"
              data-article-bio-mail
              ><i data-lucide="mail"></i></a
          ></li>
        </ul>
      </div>
    </section>
    <nav
      class="mk-article-nav"
      aria-label="More articles"
      data-i18n-aria-label-en="More articles"
      data-i18n-aria-label-de="Weitere Artikel"
    >
      <a class="mk-article-nav-link" href="#/articles/designing-for-calm" data-router-link rel="prev">
        <span class="mk-article-nav-dir"
          ><i data-lucide="arrow-left" aria-hidden="true"></i> <span data-i18n-target="prev">Previous</span></span
        >
        <span class="mk-article-nav-title">Designing for calm</span>
      </a>
      <a class="mk-article-nav-link" href="#/articles/testing-sync" data-router-link rel="next">
        <span class="mk-article-nav-dir"
          ><span data-i18n-target="next">Next</span> <i data-lucide="arrow-right" aria-hidden="true"></i
        ></span>
        <span class="mk-article-nav-title">Testing sync with a lossy network</span>
      </a>
    </nav>
    <section class="article-next" aria-labelledby="read-next">
      <h2 id="read-next" data-i18n-target="read-next">Read next</h2>
      <div class="article-next-grid">
        <article class="mk-related-item" data-variant="card" data-related-slot="0">
          <figure class="mk-related-item-media"
            ><img src="images/photos/225-600x400.webp" alt="" data-related-photo
          /></figure>
          <div class="mk-related-item-body">
            <span class="mk-related-item-kind" data-i18n-target="kind-1"
              ><span data-i18n-value="rel0Kind">Article</span></span
            >
            <h3 class="mk-related-item-title"
              ><a href="#/articles/designing-for-calm" data-router-link data-related-link>Designing for calm</a></h3
            >
            <p class="mk-related-item-meta" data-i18n-target="meta-1"
              ><span data-i18n-value="rel0Date">24 Sep 2026</span> · <span data-i18n-value="rel0Minutes">5</span> min
              read</p
            >
          </div>
        </article>
        <article class="mk-related-item" data-variant="card" data-related-slot="1">
          <figure class="mk-related-item-media"
            ><img src="images/photos/160-600x600.webp" alt="" data-related-photo
          /></figure>
          <div class="mk-related-item-body">
            <span class="mk-related-item-kind" data-i18n-target="kind-2"
              ><span data-i18n-value="rel1Kind">Guide</span></span
            >
            <h3 class="mk-related-item-title"
              ><a href="#/articles/testing-sync" data-router-link data-related-link
                >Testing sync with a lossy network</a
              ></h3
            >
            <p class="mk-related-item-meta" data-i18n-target="meta-2"
              ><span data-i18n-value="rel1Date">12 Sep 2026</span> · <span data-i18n-value="rel1Minutes">11</span> min
              read</p
            >
          </div>
        </article>
        <article class="mk-related-item" data-variant="card">
          <figure class="mk-related-item-media"><img src="images/photos/119-600x400.webp" alt="" /></figure>
          <div class="mk-related-item-body">
            <span class="mk-related-item-kind" data-i18n-target="kind-discussion">Discussion</span>
            <h3 class="mk-related-item-title"
              ><a href="full-website-comments.html" data-i18n-target="rel-discussion"
                >Your questions about offline sync</a
              ></h3
            >
            <p class="mk-related-item-meta" data-i18n-target="meta-discussion">4 comments</p>
          </div>
        </article>
      </div>
    </section>
    <section class="mk-author-list" data-variant="stack" aria-labelledby="contributors">
      <h2 class="mk-author-list-title" id="contributors" data-i18n-target="contributors">Contributors</h2>
      <ul class="mk-author-list-items">
        <li class="mk-author-list-item">
          <span class="avatar"><img class="avatar-image" src="images/avatars/47-96.webp" alt="" /></span>
          <div class="mk-author-list-who"
            ><span class="mk-author-list-name">Sophie Tan</span
            ><span class="mk-author-list-role">Staff engineer</span></div
          >
        </li>
        <li class="mk-author-list-item">
          <span class="avatar"><img class="avatar-image" src="images/avatars/32-96.webp" alt="" /></span>
          <div class="mk-author-list-who"
            ><span class="mk-author-list-name">Hannah Lee</span
            ><span class="mk-author-list-role" data-i18n-target="role-hannah">Design lead</span></div
          >
        </li>
        <li class="mk-author-list-item">
          <span class="avatar"><span class="avatar-fallback">AH</span></span>
          <div class="mk-author-list-who"
            ><span class="mk-author-list-name">Aron Homberg</span><span class="mk-author-list-role">CEO</span></div
          >
        </li>
      </ul>
      <p class="mk-author-list-summary" data-i18n-target="help">With help from Hannah Lee and Aron Homberg</p>
    </section>
  </div>
  <footer class="mk-footer article-footer" data-variant="simple">
    <div class="mk-footer-inner">
      <a class="mk-footer-brand" href="#/" data-router-link>Acme <span>Engineering</span></a>
      <ul class="mk-footer-links">
        <li><a href="full-website-blog.html">The Acme Journal</a></li>
        <li><a href="full-website-news.html">The Acme Times</a></li>
        <li><a href="full-website-comments.html" data-i18n-target="ft-discussions">Reader discussions</a></li>
        <li><a href="mailto:engineering@acme.example" data-i18n-target="ft-write">Write to the editors</a></li>
      </ul>
      <p class="mk-footer-copy" data-i18n-target="ft-copy">© 2026 Acme Inc. Engineering notes from the team.</p>
    </div>
  </footer>
  <!-- the authors the articles name: the bio under an article follows its author -->
  <script type="application/json" id="article-authors">
    {
      "Sophie Tan": {
        "img": 47,
        "mail": "sophie@acme.example",
        "role": { "en": "Staff engineer, Sync team", "de": "Staff Engineer im Sync-Team" },
        "bio": "Sophie leads the sync team at Acme. Before that she built storage engines at two databases you have heard of. She writes about distributed systems, testing, and calm engineering."
      },
      "Hannah Lee": {
        "img": 32,
        "mail": "hannah@acme.example",
        "role": { "en": "Design lead", "de": "Designleiterin" },
        "bio": "Hannah leads design at Acme and removes more than she adds. She writes about type, color and interfaces that stay quiet."
      }
    }
  </script>
  <script type="application/json" id="article-data">
    {
      "designing-for-calm": {
        "category": "Design",
        "kind": "article",
        "photo": 225,
        "alt": "A glass teapot and cups on a quiet table",
        "caption": "Tea, not alerts: the design team's Friday table.",
        "title": "Designing for calm",
        "subtitle": "Fewer badges, quieter colors, one primary action per screen.",
        "author": "Hannah Lee",
        "date": "2026-09-24",
        "minutes": 5,
        "body": [
          "Calm software asks for attention only when it has something to say. We removed half of the badges in 4.0 and nobody missed them.",
          "Every screen now has one primary action, and color means state - never decoration."
        ]
      },
      "offline-sync": {
        "category": "Engineering",
        "kind": "article",
        "photo": 60,
        "alt": "A desk with a keyboard, a tablet and a notebook",
        "caption": "The first sketch of the sync pipeline, March 2026.",
        "title": "How offline sync works in Acme 4.0",
        "subtitle": "CRDTs, a write-ahead log and a lot of patience.",
        "author": "Sophie Tan",
        "date": "2026-10-01",
        "minutes": 8,
        "body": null
      },
      "testing-sync": {
        "category": "Guide",
        "kind": "guide",
        "photo": 160,
        "alt": "A smartphone, close up",
        "caption": "The test phone behind the proxy, which drops one packet in five.",
        "title": "Testing sync with a lossy network",
        "subtitle": "Packet loss, clock skew and a proxy that lies on purpose.",
        "author": "Sophie Tan",
        "date": "2026-09-12",
        "minutes": 11,
        "body": [
          "A sync engine is only as good as the worst network it was tested on. Ours runs every merge test behind a proxy that drops, delays and reorders packets.",
          "The proxy is twenty lines of code - and it found three bugs in the first week."
        ]
      }
    }
  </script>
  <!-- the translations: one template per target and language (defuss-i18n) -->
  <template data-i18n-for="look-longform" data-i18n-locale="en">Longform</template>
  <template data-i18n-for="look-longform" data-i18n-locale="de">Langform</template>
  <template data-i18n-for="look-blueprint" data-i18n-locale="en">Blueprint</template>
  <template data-i18n-for="look-blueprint" data-i18n-locale="de">Blaupause</template>
  <template data-i18n-for="look-eink" data-i18n-locale="en">E-ink</template>
  <template data-i18n-for="look-eink" data-i18n-locale="de">E-Ink</template>
  <template data-i18n-for="date" data-i18n-locale="en"><span data-i18n-value="date"></span></template>
  <template data-i18n-for="date" data-i18n-locale="de"><span data-i18n-value="date"></span></template>
  <template data-i18n-for="read" data-i18n-locale="en"><span data-i18n-value="minutes"></span> min read</template>
  <template data-i18n-for="read" data-i18n-locale="de"><span data-i18n-value="minutes"></span> Min. Lesezeit</template>
  <template data-i18n-for="share" data-i18n-locale="en">Share</template>
  <template data-i18n-for="share" data-i18n-locale="de">Teilen</template>
  <template data-i18n-for="written" data-i18n-locale="en">Written by</template>
  <template data-i18n-for="written" data-i18n-locale="de">Geschrieben von</template>
  <template data-i18n-for="bio-role" data-i18n-locale="en"><span data-i18n-value="role"></span></template>
  <template data-i18n-for="bio-role" data-i18n-locale="de"><span data-i18n-value="role"></span></template>
  <template data-i18n-for="prev" data-i18n-locale="en">Previous</template>
  <template data-i18n-for="prev" data-i18n-locale="de">Vorheriger</template>
  <template data-i18n-for="next" data-i18n-locale="en">Next</template>
  <template data-i18n-for="next" data-i18n-locale="de">Nächster</template>
  <template data-i18n-for="read-next" data-i18n-locale="en">Read next</template>
  <template data-i18n-for="read-next" data-i18n-locale="de">Weiterlesen</template>
  <template data-i18n-for="kind-1" data-i18n-locale="en"><span data-i18n-value="rel0Kind"></span></template>
  <template data-i18n-for="kind-1" data-i18n-locale="de"><span data-i18n-value="rel0Kind"></span></template>
  <template data-i18n-for="kind-2" data-i18n-locale="en"><span data-i18n-value="rel1Kind"></span></template>
  <template data-i18n-for="kind-2" data-i18n-locale="de"><span data-i18n-value="rel1Kind"></span></template>
  <template data-i18n-for="meta-1" data-i18n-locale="en"
    ><span data-i18n-value="rel0Date"></span> · <span data-i18n-value="rel0Minutes"></span> min read</template
  >
  <template data-i18n-for="meta-1" data-i18n-locale="de"
    ><span data-i18n-value="rel0Date"></span> · <span data-i18n-value="rel0Minutes"></span> Min. Lesezeit</template
  >
  <template data-i18n-for="meta-2" data-i18n-locale="en"
    ><span data-i18n-value="rel1Date"></span> · <span data-i18n-value="rel1Minutes"></span> min read</template
  >
  <template data-i18n-for="meta-2" data-i18n-locale="de"
    ><span data-i18n-value="rel1Date"></span> · <span data-i18n-value="rel1Minutes"></span> Min. Lesezeit</template
  >
  <template data-i18n-for="kind-discussion" data-i18n-locale="en">Discussion</template>
  <template data-i18n-for="kind-discussion" data-i18n-locale="de">Diskussion</template>
  <template data-i18n-for="rel-discussion" data-i18n-locale="en">Your questions about offline sync</template>
  <template data-i18n-for="rel-discussion" data-i18n-locale="de">Eure Fragen zum Offline-Sync</template>
  <template data-i18n-for="meta-discussion" data-i18n-locale="en">4 comments</template>
  <template data-i18n-for="meta-discussion" data-i18n-locale="de">4 Kommentare</template>
  <template data-i18n-for="copied" data-i18n-locale="en">Link copied</template>
  <template data-i18n-for="copied" data-i18n-locale="de">Link kopiert</template>
  <template data-i18n-for="nav-news" data-i18n-locale="en">Newsroom</template>
  <template data-i18n-for="nav-news" data-i18n-locale="de">Newsroom</template>
  <template data-i18n-for="sh-news" data-i18n-locale="en">Newsroom</template>
  <template data-i18n-for="sh-news" data-i18n-locale="de">Newsroom</template>
  <template data-i18n-for="sh-comments" data-i18n-locale="en">Reader discussions</template>
  <template data-i18n-for="sh-comments" data-i18n-locale="de">Diskussionen der Leser</template>
  <template data-i18n-for="sh-write" data-i18n-locale="en">Write to the editors</template>
  <template data-i18n-for="sh-write" data-i18n-locale="de">Der Redaktion schreiben</template>
  <template data-i18n-for="ft-discussions" data-i18n-locale="en">Reader discussions</template>
  <template data-i18n-for="ft-discussions" data-i18n-locale="de">Leserdiskussionen</template>
  <template data-i18n-for="ft-write" data-i18n-locale="en">Write to the editors</template>
  <template data-i18n-for="ft-write" data-i18n-locale="de">Der Redaktion schreiben</template>
  <template data-i18n-for="ft-copy" data-i18n-locale="en">© 2026 Acme Inc. Engineering notes from the team.</template>
  <template data-i18n-for="ft-copy" data-i18n-locale="de">© 2026 Acme Inc. Technik-Notizen aus dem Team.</template>
  <template data-i18n-for="contributors" data-i18n-locale="en">Contributors</template>
  <template data-i18n-for="contributors" data-i18n-locale="de">Mitwirkende</template>
  <template data-i18n-for="role-hannah" data-i18n-locale="en">Design lead</template>
  <template data-i18n-for="role-hannah" data-i18n-locale="de">Designleitung</template>
  <template data-i18n-for="help" data-i18n-locale="en">With help from Hannah Lee and Aron Homberg</template>
  <template data-i18n-for="help" data-i18n-locale="de">Mit Hilfe von Hannah Lee und Aron Homberg</template>
</article>
<script type="module">
  // routing and translation: defuss-dom-router owns the address, defuss-i18n the language
  import { createRouter } from 'https://cdn.jsdelivr.net/npm/defuss-dom-router@0.1.1/dist/index.js';
  import { createDomI18n, createI18n } from 'https://cdn.jsdelivr.net/npm/defuss-i18n@0.2.0/dist/core.js';

  // df$ comes with the component bundle - a full-screen page loads it after this module
  addEventListener('DOMContentLoaded', async () => {
    // light or dark: the switch writes the page's dark class (every look has both palettes); it follows the class when
    // something else sets it (the docs card follows the site's mode)
    const siteMode = df$('#site-article [data-site-mode]');
    const syncMode = () => siteMode.prop('checked', document.documentElement.classList.contains('dark'));
    siteMode.on('change', () => {
      document.documentElement.classList.toggle('dark', siteMode.prop('checked'));
      document.dispatchEvent(new CustomEvent('defuss-theme-change'));
    });
    new MutationObserver(syncMode).observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
    syncMode();

    const site = df$('#site-article').get(0);

    // the articles the routes name, in reading order; the one on the page keeps its authored body
    const ARTICLES = JSON.parse(df$('#article-data').text());
    const AUTHORS = JSON.parse(df$('#article-authors').text());
    const ORDER = ['designing-for-calm', 'offline-sync', 'testing-sync'];
    const authored = df$('[data-article-body]').html();
    let current = ARTICLES['offline-sync'];
    // read next: the two articles that are not the one shown
    const others = () => ORDER.filter((slug) => ARTICLES[slug] !== current);
    const KINDS = { article: { en: 'Article', de: 'Artikel' }, guide: { en: 'Guide', de: 'Anleitung' } };
    // -- translation: the markup is the catalog (the templates at the end of the page)
    const locale = createI18n({
      locale: 'en', // the demos start in English; the language select offers German
    });
    const lang = (entry) => entry[locale.locale] ?? entry.en;
    const texts = createDomI18n(df$).bind(site, locale, {
      getState: () => current,
      values: (state) => ({
        date: locale.formatDate(Date.parse(state.date), { dateStyle: 'long', timeZone: 'UTC' }),
        minutes: locale.formatNumber(state.minutes),
        role: lang(AUTHORS[state.author].role),
        ...Object.fromEntries(
          others().flatMap((slug, i) => [
            ['rel' + i + 'Kind', lang(KINDS[ARTICLES[slug].kind])],
            [
              'rel' + i + 'Date',
              locale.formatDate(Date.parse(ARTICLES[slug].date), { dateStyle: 'medium', timeZone: 'UTC' }),
            ],
            ['rel' + i + 'Minutes', locale.formatNumber(ARTICLES[slug].minutes)],
          ]),
        ),
      }),
    });

    // -- Copy link: the address on the clipboard, a word that says so (a sandboxed preview may refuse the clipboard)
    df$('#site-article [data-share="copy"]').on('click', async () => {
      try {
        await navigator.clipboard.writeText(location.href);
        df$('#site-article [data-article-copied]').prop('hidden', false);
        setTimeout(() => df$('#site-article [data-article-copied]').prop('hidden', true), 2500);
      } catch {
        df$('#site-article [data-article-copied]').prop('hidden', true);
      }
    });
    // the Language Switcher sets the locale on a pick and follows it when something else sets it
    df$.shadcn.languageSwitcher.bind(df$('[data-app-locale]').get(0), locale);

    // -- the look: one of the site's designs. An element with data-look-set takes that look's attributes (a shader's
    // effect, colors or contrast); a shader reads its colors again on defuss-theme-change
    const lookRoot = df$('#site-article').get(0);
    const look = df$('#site-article [data-site-look]');
    const applyLook = (name) => {
      lookRoot.dataset.look = name;
      df$('#site-article [data-look-set]').each((_i, el) => {
        const sets = JSON.parse(el.dataset.lookSet);
        for (const [attr, value] of Object.entries({ ...sets.default, ...sets[name] })) el.setAttribute(attr, value);
      });
      document.dispatchEvent(new CustomEvent('defuss-theme-change'));
    };
    look.val(lookRoot.dataset.look).on('change', () => applyLook(look.val()));

    // -- routing
    const routes = [
      { id: 'home', path: '/' },
      { id: 'article', path: '/articles/:slug' },
      { id: 'missing', path: '*' },
    ];
    // prepare: the routed article and its body, built off the page; commit: swapped in, the values follow
    const view = (to) => {
      const slug = ARTICLES[to.params.slug] ? to.params.slug : 'offline-sync';
      const article = ARTICLES[slug];
      const author = AUTHORS[article.author];
      const near = (step) => ORDER[(ORDER.indexOf(slug) + step + ORDER.length) % ORDER.length];
      return {
        commit() {
          current = article;
          df$('.mk-article-header-category').text(article.category);
          df$('.mk-article-header-title').text(article.title);
          df$('.mk-article-header-subtitle').text(article.subtitle);
          df$('.mk-article-header-author').text(article.author);
          df$('[data-article-face]').attr('src', 'images/avatars/' + author.img + '-96.webp');
          df$('[data-article-date]').attr('datetime', article.date);
          df$('[data-article-photo]')
            .attr('src', 'images/photos/' + article.photo + '-1400x700.webp')
            .attr('alt', article.alt);
          df$('[data-article-caption]').text(article.caption);
          // the routed article's paragraphs, or the authored body of the one on the page
          const body = df$('[data-article-body]');
          if (article.body) {
            body.html('');
            for (const text of article.body) body.append(df$('<p></p>').text(text));
          } else body.html(authored);
          // the author under the article
          df$('[data-article-bio-face]').attr('src', 'images/avatars/' + author.img + '-160.webp');
          df$('[data-article-bio-name]').text(article.author);
          df$('[data-article-bio-text]').text(author.bio);
          df$('[data-article-bio-mail]').attr('href', 'mailto:' + author.mail);
          // read next: the other two articles
          others().forEach((other, i) => {
            const card = df$('[data-related-slot="' + i + '"]');
            card
              .find('[data-related-link]')
              .attr('href', '#/articles/' + other)
              .text(ARTICLES[other].title);
            card.find('[data-related-photo]').attr('src', 'images/photos/' + ARTICLES[other].photo + '-600x400.webp');
          });
          for (const [rel, step] of [
            ['prev', -1],
            ['next', 1],
          ]) {
            const link = df$('.mk-article-nav-link[rel="' + rel + '"]');
            link.attr('href', '#/articles/' + near(step));
            link.find('.mk-article-nav-title').text(ARTICLES[near(step)].title);
          }
          texts.refresh();
        },
      };
    };
    const show = (to) => view(to).commit();
    // a new page opens at its start, the way a page load would - the first view stays where the reader is
    let shownPath = null;
    const showAt = (to) => {
      show(to);
      if (shownPath !== null && shownPath !== to.path)
        df$('#site-article .mk-article-header').get(0)?.scrollIntoView({ block: 'start', behavior: 'instant' });
      shownPath = to.path;
    };
    const router = createRouter({ mode: 'hash', routes, prepare: ({ to }) => ({ commit: () => showAt(to) }) });
    router.attachLinks(site);
    if ((await router.start()).status === 'rejected') {
      // no address the router may own - a docs preview is an about:srcdoc frame: the same routes match its hash
      const preview = createRouter({ mode: 'hash', routes, baseUrl: 'https://preview.invalid/' });
      const follow = () => showAt(preview.resolve(location.hash.startsWith('#/') ? location.hash : '#/'));
      // a section link (#article-bio) only scrolls - the article stays
      addEventListener('hashchange', () => {
        if (location.hash.length < 2 || location.hash.startsWith('#/')) follow();
      });
      follow();
    }
  });
</script>
```

<h2 id="blocks" class="h2-display">The blocks</h2>

<div class="grid gap-4 mb-8" style="grid-template-columns:repeat(auto-fill,minmax(16rem,1fr))">
  <a class="card" data-size="sm" href="article-header.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Article Header</h3>
      <p class="card-description">Presents an article's title, subtitle, author, and publication date - with a lead image and caption, centered, or as a cover.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="article-body.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Article Body</h3>
      <p class="card-description">Renders an article's formatted text and embedded media - headings, lists, quotes, code, tables, figures, video and iframes, from plain HTML.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="author-bio.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Author Bio</h3>
      <p class="card-description">Introduces one author with a portrait, biography, and links - between rules under an article, on a card, or as a centered profile.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="author-list.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Author List</h3>
      <p class="card-description">Lists contributors associated with a publication or article - rows with roles and counts, a card grid, or a stack of overlapping avatars.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="related-item.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Related Item</h3>
      <p class="card-description">Links to one related article or resource with a preview - a compact row with a thumbnail, a card, or text with an arrow.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="share-links.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Share Links</h3>
      <p class="card-description">Provides sharing actions for the current content - share-intent links, email, copy link and the native share sheet, as a row, labeled, or a vertical rail.</p>
    </div>
  </a>
  <a class="card" data-size="sm" href="article-navigation.html" style="text-decoration:none;color:inherit">
    <div class="card-header">
      <h3 class="card-title card-title-sm">Article Navigation</h3>
      <p class="card-description">Links to the previous and next articles - rel=&quot;prev&quot; / rel=&quot;next&quot; cards with direction and title, or a minimal text row.</p>
    </div>
  </a>
</div>

</DocPage>
