v2.0.2

Style guide

Every Canopy page is drawn from one small set of styles: two families, two weights, eleven text styles, a palette from your theme, and a few shapes and steps of space. Components use nothing else, so a change you make in canopy.yml or in a token restyles every one of them.

This page draws each style with the stylesheet your site ships, in its theme, so what you see is what your pages get. Its numbers are read from the page as it renders.

Type

Canopy sets type as a magazine does: a sans for headlines and the interface, a serif for reading.

Families

  • Google Sans Flex

    Headlines and the interface.

    --font-sans, --canopy-font-display

  • Source Serif 4

    Reading text.

    --font-serif, --canopy-font-body

  • The system’s monospace

    Code.

    --font-mono

Weights

Two weights, and only two: bold (700) for headings, labels, a card's title and emphasis, and regular (400) for everything else. Hierarchy comes from size and color, not from weights in between.

Text styles

Every piece of text on a page is one of these. Headings, paragraphs and lists you write in Markdown take them on their own; components take them from the stylesheet.

Explore the collection

Display · .canopy-type-display

@include type.display

A hero's headline, once a page.

Maps of the Indian subcontinent

Title · .canopy-type-title

@include type.title

A page's title, its h1 (# in Markdown), and a section's: Feature, Band.

Surveying the coast

Heading 2 · .canopy-type-h2

@include type.h2

A section within a page: ## in Markdown, a list of related works.

The first printed charts

Heading 3 · .canopy-type-h3

@include type.h3

### in Markdown; a dialog's title; a timeline's.

Sources and further reading

Heading 4 to 6 · .canopy-type-h4

@include type.h4

#### to ###### in Markdown; a slider's title; a page result's; the site's name.

Paintings and prints from libraries and museums, gathered in one place.

Lede · .canopy-type-lede

@include type.lede

Words under a title: .canopy-lead, a work's summary, the hero's description, a Feature's words, the footer's sentence, a quotation.

By the early nineteenth century, the East India Company had transformed from a trading enterprise into a territorial power, exercising corporate sovereignty across much of the subcontinent.

Body · .canopy-type-body

@include type.body

What an author writes: paragraphs, lists and notes, held to a 70-character line.

Works · About · Search the collection

Interface · .canopy-type-ui

@include type.ui

Navigation, fields, menus, a card's title (in bold), a metadata value, a table's cells.

Get started · 24 results · 1896, lithograph

Interface, small · .canopy-type-ui-sm

@include type.ui-sm

Buttons, captions, a card's second line, the footer, tabs, filters, counts.

Subject

Label · .canopy-type-label

@include type.label

Over a value or a section: a metadata field, a table's head, an eyebrow (in the accent).

collection: https://example.org/iiif/collection.json

Code · .canopy-type-code

@include type.code

Code in running text and in blocks.

Use them in your own markup with their classes:

StyleClassSize token
Displaycanopy-type-display--canopy-text-display
Titlecanopy-type-title--canopy-text-title
Heading 2canopy-type-h2--canopy-text-2xl
Heading 3canopy-type-h3--canopy-text-xl
Heading 4 to 6canopy-type-h4--canopy-text-lg
Ledecanopy-type-lede--canopy-text-lede
Bodycanopy-type-body--canopy-text-body
Interfacecanopy-type-ui--canopy-text-md
Interface, smallcanopy-type-ui-sm--canopy-text-sm
Labelcanopy-type-label--canopy-text-label
Codecanopy-type-code--canopy-text-code
<p className="canopy-type-label">Featured</p><p className="canopy-type-lede">Prints and drawings from three collections.</p>

A class sets the look only. Use the element that says what the text is, such as a heading for a heading, so the page's outline stays right.

Color

Colors come from your theme (accentColor, grayColor and appearance in canopy.yml). Canopy holds each pair of text and ground at 4.5:1 or more, and each control's edge and focus ring at 3:1, for every palette, in light and dark.

Text

  • Body text

    --color-gray-default

    The page’s words. 4.5:1 or more on every surface.

  • Muted text

    --color-gray-muted

    Ledes, captions, labels. 4.5:1 or more on every surface.

  • Accent text

    --color-accent-default

    Links, accent words, focus rings, a checked box.

Fills

  • Primary fill

    --color-accent-default

    A primary button; its label is accent 50.

  • Primary hover

    --color-accent-hover

    The fill under the pointer, away from its label.

  • Label on a fill

    --color-accent-50

    The words on a primary fill, 4.5:1.

  • Accent, solid

    --color-accent-600

    A quotation’s rule.

Surfaces and edges

Panels are solid fills, not outlines; cards are lifted off the page with a hairline and a soft shadow.

  • Page

    --color-gray-50

    The ground everything stands on.

  • Surface

    --canopy-surface

    A panel’s solid fill: filters, chips, a field’s hint.

  • Raised

    --canopy-surface-raised

    A card’s fill: the page in light, lighter in the dark.

  • Sunken

    --canopy-surface-sunken

    A well. No muted text on it.

  • Hairline

    --canopy-edge

    A card’s edge, a rule. Decoration only.

  • Control edge

    --canopy-control-edge

    A field’s and an outline button’s edge, 3:1.

Black

A band and a code block are black in both appearances.

  • Black

    --canopy-band-background

    A band and a code block, in both appearances.

  • On black

    --canopy-band-text

    Words on black, 21:1.

  • Muted on black

    --canopy-band-muted

    Quieter words on black, 9:1 or more.

Shape

Corners nest: what sits inside a rounded thing takes a smaller step. Search fields and round controls are pills.

  • --canopy-radius-sm

  • --canopy-radius-md

  • --canopy-radius-lg

  • --canopy-radius-xl

  • --canopy-radius-pill

  • Small

    --canopy-shadow-sm

  • Medium

    --canopy-shadow-md

  • Large

    --canopy-shadow-lg

  • Card

    --canopy-card-shadow

  • Focus ring

    --canopy-focus-ring

Keyboard focus is always a ring in the accent, standing off the element so the page shows between, as above.

Space

Space steps on the golden ratio from the page's 1rem. The more closely two things belong together, the smaller the step between them; a container's inset is a step larger than the gap between what it holds.

  • --canopy-space-3xs

  • --canopy-space-2xs

  • --canopy-space-xs

  • --canopy-space-s

  • --canopy-space-m

  • --canopy-space-l

  • --canopy-space-xl

  • --canopy-space-2xl

Components

Buttons

A section's introduction

Eyebrow

A section's title

A lede under it, in the reading serif, muted, and whatever follows.

A call to action

A band's title

A sentence on black, in the reading serif.

Words in a page

A paragraph as an author writes it, with a link, some emphasis, bold words and inline code.

A quotation, set apart from the text around it.

  • A list item
  • Another, as long as it needs to be to show how a list's lines wrap across the column.
  1. A numbered step
  2. And the next