Origin Canvas is a WordPress block theme. Patterns live in patterns/*.php: a doc-block header
registers each one and the body is block markup. Read these rules before creating, renaming or
recategorizing a pattern.
- Audience: solo builders, freelancers and small teams who build WordPress sites, for clients or for themselves; small agencies are next.
- Surfaces: the theme's frame, setup and docs are judged for that builder. Demo pages and patterns are judged for the visitors of the business the page portrays (an attorney's clients, a gym's new members) and for the job of each row. When the business is unknown, check contrasting real uses; never impose Origin's own look.
- Before changing a visual value: name the reader and the surface, look at the change on the real page, and say what the reader gains. Fitting a scale is not a reason.
- A new look for Canvas is a new style variation in
styles/, never a change to the default look.
- Every design decision lives in the code, in a
bin/check-*.shor in a GitHub issue in this repo, in the same step as the change, never only in a scratch folder, a chat or an agent's memory. Record a new trap the same way. Never commit private detail, design notes, lessons or an archive. - Some rules have a check; a rule with no check is held only by review.
bin/package-theme.shruns every check that needs nothing outside this repo, the shipped-values check with--release, so a pending removal stops the package. Runcheck-block-validity.sh(needs WordPress) andcheck-tracking-render.sh(needs a browser) before a merge. - An issue that holds a rule closes only when the rule lives in a check (its exceptions named there, each with a reason) or in a code comment next to the code it governs, or is dropped on purpose with the reason on the issue. A closed issue is history, not a rule.
- Merge gate: the reviewer matches every commit that cites a decision against the code, check or issue that holds it. If none does, the merge stops.
- A release follows
RELEASE.md; read it before any tag, version or changelog work. - Report verification honestly: name the method of each check, and list any check not done.
- Every user-visible string follows the house writing guide. The pattern title, description, keyword and category rules stay in this file; add writing rules to the guide, never here.
Every pattern slug and custom category is origin-canvas/<kebab-slug>, never origin/. Hidden
template scaffolds use origin-canvas/hidden-*.
Give each pattern one category: the first match in this list. It runs specific to generic, so
two people reach the same answer (a hero with a CTA is hero, a pricing table with stats is
pricing). Bare slugs are core's; origin-canvas/ ones are registered in functions.php →
origin_canvas_register_pattern_categories().
origin-canvas/hero— the main heading at the largest size, with a lead or buttonstestimonials— a quote or revieworigin-canvas/pricing— a pricing table or tierorigin-canvas/stats— a metrics or numbers bandteam— people or team cardsorigin-canvas/features— a feature grid or listorigin-canvas/faq— Q&Acontact— a contact form or detailsgallery— an image galleryorigin-canvas/logos— a logo striporigin-canvas/author— an author or byline cardorigin-canvas/card— a generic reusable cardposts— a query or blog loopcall-to-action— a conversion section (a newsletter signup counts)text— editorial content with no more specific roleorigin-canvas/page— a full-page composition only
Header and footer patterns use the bare header and footer; template scaffolds use hidden.
Never invent a category, least of all one WordPress already registers (banner, query and
the core slugs above): a twin puts two entries in the inserter for one thing. Check with
WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( 'slug' ). Growing the
set takes this list and a matching category: <slug> GitHub label, in the same change.
Name a pattern for what it is, so any page can use it: stat-band, features-grid,
testimonial-single, never landing-* or <page>-<section>. Names, titles, descriptions and
keywords go job, then layout, then style, with no position or page word; keywords may carry true
use words ("about page", "introduction"). A shipped slug is never renamed.
Page patterns are page-<role>-NN: the role is the page's job (home, about, pricing, contact,
services) and the number tells versions apart. Never renumber or reuse a number, retired ones
included (page-home-01 became page-studio). The title describes the page without the number
("Home: Centered Hero"); site type, tone and layout go in keywords. page-studio and
page-landing-01 keep their shipped slugs.
Name a file in patterns/images/ for what it shows (exercise-room.webp), never for the pattern
or slot that first used it. The only prefixes are avatar-, portrait- and logo-, followed
by the person or client. A shipped name stays until a major version, because saved content
points at its URL. When no pattern uses an image any more, its file stays, overwritten with a
copy of the image that now holds its slot, and its readme.txt credit says so (390db7d).
bin/check-image-names.sh holds the grammar and its exceptions; whether a name fits its
picture is the reviewer's read.
A page pattern's body is only <!-- wp:pattern {"slug":"origin-canvas/…"} /--> references.
Model: patterns/page-studio.php.
Every pattern opens with this header; change only the variable fields:
<?php
/**
* Title: <Human Title>
* Slug: origin-canvas/<kebab-slug>
* Description: <one sentence: what a user sees in the pattern>
* Categories: <one category>
* Keywords: <comma, separated, terms>
* Viewport Width: 1500
* Block Types:
* Post Types:
* Inserter: true
*
* @package Origin
*/
?>- Inserter:
true, except hidden template scaffolds (registered infunctions.php), the landing page's own showcase sections (pattern-showcase,style-variations,template-showcase,token-system,product-grid) and retired patterns (breath-statement), which keep their file and slug until a major version. - Keywords: 3–6 words a user might type that the title, slug and description lack: synonyms, content words, true use words (rule 3), and the category word if none of them has it.
Every colour, spacing and font size is a preset from theme.json. The scales are fluid
(clamp()), so a hardcoded px opts out of fluid type and spacing and out of every style
variation.
- Inline hex only for sanctioned per-product identity marks.
- Dark bands write no hex.
custom.dark.bgiscontrastandcustom.dark.textisbase-2, so a variation's ink reaches every dark pattern; new dark patterns use thecontrastandbase-2presets directly. Secondary text isbase-2at 72%, hover fills 8% and lines 12%, each acolor-mixofvar(--wp--custom--dark--text)(#127). - If a design hands you a value that isn't on the scale, do NOT hardcode it and do not snap
it. A near step changes the rendering. Report the gap and ask the owner: use an existing
step, or add one to
theme.json. - Spacing presets are fluid ranges: pick the token whose max matches the design value, never a flat px to hit a number.
- Outside the rule: a
max-widthreading measure, and element dimensions (an avatar, an icon bubble, a fixed media column), which have no scale. Where patterns share a dimension, put it in a class so they cannot drift (.origin-canvas-quote-mark). - Icons use the core Icon block; a decorative glyph the Icon block can't draw comes from the theme's CSS.
A change to an existing block rule made so one pattern lands is never the fix. Exhaust core
first: Row, Stack and Grid child sizing (Fill, Fit, Fixed), the block styles core ships, the
colour, border and spacing supports, and per-viewport Hide. divider-with-text is the
reference: two separators set to Fill and a label at Fit, with no pattern CSS. While 7.0 is the
minimum, Fixed is saved as "fixed" plus the origin-canvas-no-shrink utility (style.css
says why).
A job core cannot do but more than one pattern needs becomes a utility, named for the job, in
the Utilities section of style.css. Add one only for a real second use. Anything else goes
where it loads least: the core-<block>.css of a block most pages lack (Cover, Accordion), or
else the "Pattern CSS" section at the end of style.css, one commented section per pattern. A
class is the hook: core has no per-pattern loader, and Additional CSS rules are stripped when an
Author saves. Ask the owner before adding pattern CSS.
Every wp:heading in a pattern sets fontSize and the matching has-<preset>-font-size class.
A bare heading takes the theme.json element ladder, which is tuned for authored prose, and a
ladder change must never move a shipped pattern.
Weight belongs to the style variation, at styles.elements.heading. An inline fontWeight
emits a style attribute that beats every variation, and our landing page sells one-click
style variations. For a new block: if it renders as h1–h6, the variation owns its weight; if
it renders a <p> (the site title at level: 0), the block is the only lever and a pin is
correct. The comment reply title is pinned in both theme.json and core-comments.css: change
both or neither. The statement register (breath-statement, text-large-statement,
lead-statement) pins fontWeight: 500 and nothing else: lighter than the voice is its
identity. bin/check-heading-pins.sh and bin/lib/check-heading-blocks.py hold every
exemption.
Tracking follows size: settings.custom.letterSpacing holds one token per size band, and
style.css maps the preset classes and heading levels to them. Heading tracking is one value at
styles.elements.heading. Never set it per level or on a heading block, in theme.json, a
variation or CSS, or a Global Styles "Headings" letter spacing stops reaching every level. A
variation with another face overrides only the tokens or that one value. A pattern never sets letterSpacing on a heading or statement; eyebrows and labels stay at
0.06em. bin/check-tracking-tokens.sh and bin/check-tracking-render.sh hold the bands.
A change to a template part or a widely reused pattern is justified against every page that
uses it, never one composition. A page that wants a different header needs a different header,
not an edit to the shared one: design the component family on its own terms, then assign it per
template. To change a section's text for one page, copy the section into a new pattern and
change the copy, because every page that references the section changes with it
(grep -rl 'origin-canvas/<slug>' patterns finds them). A raw value with an exact token
equivalent is tokenised; one without is reported to the owner, never snapped (rule 6).
A secondary button is is-style-outline on a white or tinted surface and
is-style-origin-canvas-outline-light on a dark one. The surface is the nearest block that sets
a fill. bin/check-button-surfaces.sh holds the table. Outline Strong is retired; never use it.
After editing a pattern, run bin/normalize-patterns.sh: it writes the markup as the editor
saves it and keeps the WordPress 7.0 forms the minimum still needs. Markup the editor rewrites
makes the user's saved page differ from the pattern; bin/check-block-validity.sh fails on it.
Copy markup from the editor's Code editor, never from the rendered page.