Skip to content

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

Merged
ogorzalka merged 2 commits into
mainfrom
feat/gutenberg-design-system
Sep 30, 2026
Merged

ogorzalka merged 2 commits into
mainfrom
feat/gutenberg-design-system

Conversation

@ogorzalka

@ogorzalka ogorzalka commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Why

Unlike Buzz, the default theme had no real design system for core blocks: content was styled on the front only (.entry-content CSS in app.css), so the editor showed something else, and the theme.json styles it had pointed at Tailwind variables (var(--text-base), var(--color-white), var(--container-xl)) that do not exist in the editor. On the page, h4–h6 were larger than h2–h3 and the primary button's label was invisible.

What

  • theme.json styles every core block from the @theme presets only: root, elements (h1–h6, button, caption, cite), links inside content blocks only (paragraph, list, table, verse — a global rule reached every template and plugin link), and blocks — heading, list, quote (the gradient border moved from app.css), pullquote, button/outline, separator, table, code, preformatted, verse, details, image, gallery, group, search, post/query/site title. contentSize 44rem / wideSize 64rem, as in the Blade templates.
  • app/Cms/StyleLayers.php: WordPress prints its block library and global styles unlayered, so h2 {} from theme.json would beat text-sm on a Blade heading, and the block library's pill button would beat the theme.json one. Its CSS now goes in layers declared at the top of app.css — theme, base, wp-core, wp, components, utilities — inline styles wrapped, linked ones @imported into their layer. Independent of print position (WordPress 7 prints these styles in the footer of a Blade page).
  • Inter is the variable font it claimed to be: Inter-Regular.woff2 was a static 400 declared 100 900, so no weight ever rendered bold once the content used the theme font. Replaced by the official InterVariable*.woff2 (v4.1, OFL, licence alongside).
  • Templates: content wrappers get is-layout-flow (block gap as in the editor), chrome links no-underline, the wp-element-button trick on CTAs replaced by no-underline, an excerpt no longer nested in a <p>.
  • Contract tests: every preset / custom variable the styles use exists (with WordPress's 5xl → 5-xl naming), no Tailwind-only variable, no selector list in a block's css. They fail on v1.5.0's theme.json.

Checked

Kitchen-sink post (every core block) on a fresh 13.34.0 site, front vs editor screenshots side by side; home, archive and 404 unchanged apart from the fixes above. php bin/tests/run.php: 26 checks; bin/ci/check-install.php: 17 checks.

…or and on the page

theme.json styles every core block from the @theme presets; WordPress's CSS goes in
cascade layers under Tailwind's utilities; Inter is the variable font it claimed to be.
…e height outside them

A global link style reached every link of the Blade templates and of plugin markup
without a colour utility; paragraphs and lists now carry it. Captions are centred.
@ogorzalka
ogorzalka merged commit 43e9ca9 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