Canvas Design System
Main Site Tokens

Exercise Tile

One exercise as a square: its two-letter symbol, the step's minutes and its name. Three in a row, joined by plus signs, are a recipe.

When to Use

Use when: A recipe names its exercises. ws_exercise_formula draws them in the order they run; a single ws_exercise_tile is one exercise at a glance. The minutes are the step's, so they change with the recipe's length.
Don't use when: Browsing exercises, where a Listing Card carries the title, duration and category; or inside the Planner, which uses its own planner card. A running order with start times is an Agenda.

Variants

The formula

Three tiles in order, joined by plus signs. Every tile keeps the same width; below 600px they stack, with each plus sign between them.

<?= ws_exercise_formula([
    ['symbol' => 'Bw', 'name' => 'Brainwriting', 'minutes' => 20, 'href' => '/library/exercises/detail/?code=brwritg'],
    ['symbol' => 'Af', 'name' => 'Affinity Diagramming', 'minutes' => 20, 'href' => '/library/exercises/detail/?code=affinity'],
    ['symbol' => 'Dv', 'name' => 'Dot Voting', 'minutes' => 25, 'href' => '/library/exercises/detail/?code=dotvote'],
], ['label' => 'The three exercises, in order']) ?>

One tile

With href the whole tile is a link; without minutes the corner stays empty.

<?= ws_exercise_tile(['symbol' => 'Pv', 'name' => 'Point of View Statement', 'minutes' => 15, 'href' => '/library/exercises/detail/?code=povstatement']) ?>
<?= ws_exercise_tile(['symbol' => 'Sf', 'name' => 'Stinky Fish']) ?>

Options

ws_exercise_tile

OptionTypeDefaultPurpose
symbolstringrequiredTwo letters, capital then lowercase, one per exercise everywhere it appears
namestringrequiredThe exercise's display name. The capitals are CSS.
minutesintnullThe step's minutes; omitted, the corner stays empty
hrefstring''Makes the whole tile a link
idstring''Element ID
classstring''Additional CSS classes
attrsarray[]Extra HTML attributes

ws_exercise_formula

OptionTypeDefaultPurpose
$tilesarrayrequiredEach tile's ws_exercise_tile options, in order
labelstring''The list's accessible name, when no heading right above names it
idstring''Element ID
classstring''Additional CSS classes
attrsarray[]Extra HTML attributes

Accessibility

ConcernBehavior
Reading orderThe name comes first in the markup and the minutes follow in words, so a tile reads "Brainwriting, 20 minutes". The grid areas move them visually only.
Symbolaria-hidden: it is a visual shorthand, and "B w" read aloud means nothing.
Capitalstext-transform, not typed capitals, so a screen reader never spells the name letter by letter.
FormulaAn ordered list, announced with its count. The plus signs are aria-hidden: the order already says what follows what.
LinksWith href the tile is one link named by its text, with a visible focus ring.

Tokens

TokenUsed for
--bg-surface, --card-borderThe tile's white fill and its 2px border
--brand-inkThe symbol and the plus signs
--font-heading, --text-display-lgThe symbol: Fraunces
--font-body, --text-small, --text-metaThe minutes and the name: Inter
--brandA linked tile's border on hover
--focus-ringA linked tile's focus ring

CSS Classes

ClassPurpose
.ws-exercise-tileThe square
.ws-exercise-tile--linkA tile with href
.ws-exercise-tile__symbol / __minutes / __nameTop left, top right, bottom right
.ws-exercise-formulaThe ordered list
.ws-exercise-formula__itemOne tile's slot, all the same width
.ws-exercise-formula__plusThe plus sign in the gap before a tile

Files

FilePurpose
includes/components/helpers.phpws_exercise_tile() and ws_exercise_formula()
includes/components/exercise-tile.phpTemplate: one tile
includes/components/exercise-formula.phpTemplate: the list of tiles and plus signs
includes/components/components.cssStyles (.ws-exercise-tile and .ws-exercise-formula rules)