Skip to main content

Styleguide

A reference page for all the design tokens and markdown content elements used on this site.

Design tokens #

Font families #

The quick brown fox jumps over the lazy dog.

--token-font-family-serif: "Source Serif 4", Georgia, serif

The quick brown fox jumps over the lazy dog.

--token-font-family-sans-serif: system-ui, sans-serif

The quick brown fox jumps over the lazy dog.

--token-font-family-monospace: ui-monospace, Consolas, monospace

Colours #

Semantic colours resolved through light-dark() and dependent on the active theme:

--color-bg
--color-bg-alt
--color-text
--color-text-muted
--color-heading
--color-border
--color-accent
--color-accent-alt
--color-accent-text
--color-text-inverse
--color-focus
--color-code
--color-code-bg
--color-forest
--color-forest-text

Base palette of primitive colour tokens:

--token-color-black
--token-color-black-muted
--token-color-gray-dark
--token-color-gray-light
--token-color-gray-extra-light
--token-color-gray-warm
--token-color-white
--token-color-white-muted
--token-color-ivory
--token-color-yellow
--token-color-orange
--token-color-crimson
--token-color-blue
--token-color-graphite
--token-color-charcoal
--token-color-forest
--token-color-green

Font sizes #

--token-font-size-xs (14px)

The quick brown fox

--token-font-size-sm (18px)

The quick brown fox

--token-font-size-md (22px)

The quick brown fox

--token-font-size-lg (30px)

The quick brown fox

--token-font-size-xl (62px)

The quick brown fox

Font weights #

--token-font-weight-light (300)

The quick brown fox jumps over the lazy dog.

--token-font-weight-normal (400)

The quick brown fox jumps over the lazy dog.

--token-font-weight-bold (600)

The quick brown fox jumps over the lazy dog.

Line heights #

--token-line-height-sm (1.15)

Observables represent a collection of events, or values, that arrive over time. Signals represent a single value that changes over time.

--token-line-height-md (1.5)

Observables represent a collection of events, or values, that arrive over time. Signals represent a single value that changes over time.

--token-line-height-lg (2)

Observables represent a collection of events, or values, that arrive over time. Signals represent a single value that changes over time.

Spacing #

--token-spacing-xxs (4px)
--token-spacing-xs (8px)
--token-spacing-sm (16px)
--token-spacing-md (24px)
--token-spacing-lg (32px)
--token-spacing-xl (48px)
--token-spacing-xxl (64px)

Border radius #

--token-border-radius-default: 3px

Content elements #

Headings #

Sections in a post use ## for the top level and ### for subsections, as seen above. There's no # in the body: the layout renders its own <h1> from the front matter title, and .common-main-content h1 is hidden by CSS to prevent a second one.

Paragraphs and inline text #

A paragraph can hold bold text, italic text, inline code, and a link. Here's a second paragraph, so the spacing between paragraphs is visible too.

Lists #

An unordered list:

An ordered list:

  1. First
  2. Second
  3. Third

Blockquotes #

An observable is a collection whose values arrive over time, or in other words, an asynchronous collection.

Horizontal rule #

A paragraph before the rule.


A paragraph after the rule.

Tables #

StatePopulationCapital
NSW8.641 MSydney
VIC7.121 MMelbourne
TAS0.579 MHobart
ACT0.487 MCanberra
SA1.910 MAdelaide
WA3.076 MPerth
NT0.267 MDarwin
QLD5.712 MBrisbane

Maths #

Inline LaTeX like E=mc2E = mc^2 sits within a sentence.

A block equation:

0ex2dx=π2\int_0^\infty e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2}

Code #

Inline code like const x = 1 sits within a sentence.

A fenced code block:

function debounce(fn, wait) {
	let timeout;
	return (...args) => {
		clearTimeout(timeout);
		timeout = setTimeout(() => fn(...args), wait);
	};
}

The same highlighter covers other languages used across posts:

.common-main-content blockquote {
	border: 1px solid var(--color-border);
	padding: var(--token-spacing-sm) var(--token-spacing-md);
}
<button type="button" aria-pressed="false">Toggle</button>
npx @11ty/eleventy --serve
{ "name": "blog", "private": true }

A line can be marked as highlighted, added, or removed. This block highlights line 2:

const els = document.querySelectorAll(".item");
els.forEach((el) => el.classList.add("active"));
console.log(els.length);

This block marks line 2 as removed and line 3 as added:

const response = await fetch(url);
const data = await response.json().then((res) => res);
const data = await response.json();

A unified diff, using Prism's diff language:

- axios.get("/users").then((res) => res.data);
+ fetch("/users").then((res) => res.json());