Skip to main content

  • Foundations
    • Border radius
    • Breakpoints
    • Colours
    • Colour scheme
    • Elevation
    • Focus and outline
    • Sizing and spacing
    • Layout
    • Motion
    • Typography
    • Z-index
  • Elements
    • Buttons
    • Code
    • Icons
    • Figure and caption
    • Forms
    • Links
    • Lists
    • Media
    • Tables
  • Components
    • Accordion
    • Alerts
    • Avatar
    • Blockquote
    • Breadcrumbs
    • Card
    • Chiplets
    • Details and summary
    • Dialog
    • Empty state
    • Stats
    • Global footer
    • Horizontal rule
    • Kanban
    • Key-value list
    • Meter
    • Objects
    • Pagination
    • Polka background
    • Post-it note
    • Progress
    • Speech bubbles
    • Status dot
    • Skeleton
    • Skip link
    • Spinner
    • Toggles
    • Tooltip
    • Webmentions
  • Patterns
    • Article header
    • Author card
    • App list and app sheet
    • Error page
    • Related posts
    • Search results
    • Utilities

John Peart

  • Search
  • Menu
John Peart

Code

Inline code, pre blocks, keyboard input, sample output and variables.

Code uses a system monospace stack (--font-mono). Inline code scales down to the surrounding paragraph size so it never balloons in headings; block-level code uses its own fluid size, --font-size-code.

Inline code

Use const for values that don't rebind, and wrap long paths like /engine/styles/components/alerts.css so they break at sensible points.

<p>Use <code>const</code> for values that don't rebind.</p>

Pre-formatted block

function greet(name) {
  if (!name) throw new Error("name required");
  return `Hello, ${name}!`;
}

Keyboard input

The <kbd> element styles as a 3D key with a bottom shadow that matches the press-down pattern.

Press ⌘+K to open search, or Esc to dismiss.

<p>Press <kbd>⌘</kbd>+<kbd>K</kbd> to open search.</p>

Sample output

<samp> represents program output — rendered in the monospace stack at the secondary-text colour.

Running the build prints: built 47 files in 820ms

Variable

<var> is used for placeholders inside prose — e.g. inside a command signature.

Run eleventy --input=dir --output=dir with the directory of your choice.

Long lines

Block code scrolls horizontally when lines exceed the content width. Inline code wraps at word boundaries, with overflow-wrap: anywhere as a last resort for long identifiers.

A line drawing of John Peart

John Peart

www.johnpe.art

Mastodon logo

Mastodon

BlueSky logo

Bluesky

LinkedIn logo

LinkedIn

Github logo

GitHub