Skip to content

feat: a Gutenberg design system for core blocks - #14

Merged
ogorzalka merged 1 commit into
mainfrom
feat/gutenberg-design-system
Sep 30, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
feat/gutenberg-design-system

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Why

Unlike Buzz, Apiary had no design system for core blocks: theme.json declared no styles, so the editor showed WordPress's defaults (full width, no type scale), while the front styled content with Tailwind Typography (prose). Editor and page never matched.

What

  • theme.json styles every core block from the @theme presets: root, elements (h1–h6, button, caption, cite), and blocks — paragraph, heading, list, quote (amber rule), pullquote, button/outline, separator, table, code, preformatted, verse, details, image, gallery, group, search, post/query/site title. contentSize 45rem (the post column), wideSize 80rem.
  • Links are styled inside content blocks (paragraph, list, table, verse), never globally: a global link rule reached WooCommerce's and the templates' own links (a product's category link went from muted to underlined foreground before this was scoped).
  • app/Cms/StyleLayers.php (same as theme-default): WordPress's block library and global styles go in cascade layers under Tailwind's utilities — theme, base, wp-core, wp, components, utilities — so theme.json beats the reset and the block library, and a Tailwind class in a template always wins. Independent of where WordPress 7 prints them (the footer of a Blade page).
  • Post and page content: prose → is-layout-flow (the block gap, as in the editor). Product descriptions keep prose.
  • bin/tests/design-system.php, run in the Contract job: every preset / custom variable the styles use exists (WordPress's 2xl → 2-xl naming), no Tailwind-only variable, no selector list in a block's css.

Checked

On a fresh 13.34.0 site with WooCommerce and the CI shop seed: a kitchen-sink post (every core block), front vs editor, now match. Home, shop, product and account compared with main pixel by pixel: same layout and heights; the remaining differences are default text going from #000 to the palette's foreground, and on My account the form sits 8px higher and "Lost your password?" is no longer underlined — both came from prose leaking into the WooCommerce page, the template's own classes now apply.

…or and on the page

theme.json styles every core block from the design tokens; WordPress's CSS goes in cascade
layers under Tailwind's utilities; post and page content drop prose for the block styles.
@ogorzalka
ogorzalka merged commit 3be7e51 into main Sep 30, 2026
3 checks passed
@ogorzalka
ogorzalka deleted the feat/gutenberg-design-system branch September 30, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant