feat: a Gutenberg design system for core blocks - #14
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Unlike Buzz, Apiary had no design system for core blocks:
theme.jsondeclared nostyles, 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.jsonstyles every core block from the@themepresets: 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.contentSize45rem (the post column),wideSize80rem.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).prose→is-layout-flow(the block gap, as in the editor). Product descriptions keepprose.bin/tests/design-system.php, run in the Contract job: every preset / custom variable the styles use exists (WordPress's2xl→2-xlnaming), no Tailwind-only variable, no selector list in a block'scss.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
mainpixel by pixel: same layout and heights; the remaining differences are default text going from#000to the palette'sforeground, and on My account the form sits 8px higher and "Lost your password?" is no longer underlined — both came fromproseleaking into the WooCommerce page, the template's own classes now apply.