Add setting to expand all typography controls in the block inspector#824
Open
Add setting to expand all typography controls in the block inspector#824
Conversation
Adds an opt-in "Editor preferences" panel in the Create Block Theme sidebar with a single toggle that expands every typography control in the block inspector by default, instead of hiding them behind the ToolsPanel ellipsis menu. Intended for theme authors iterating on typography. - New blocks.registerBlockType filter populates __experimentalDefaultControls on supports.typography based on the controls the block already declares. Mapping verified against gutenberg/packages/block-editor/src/components/global-styles/ typography-panel.js. - Preference stored in @wordpress/preferences under scope create-block-theme, key expandAllTypographyControls. - Toggle auto-reloads the editor in both directions, matching the existing save/reset/variation reload pattern in CBT. - Applies in the Site Editor only (CBT's sidebar bundle is gated to site-editor.php); help text notes this. Fixes #823
The eslint-import-resolver-typescript used by @wordpress/eslint-plugin v24 fails to resolve @wordpress/hooks specifically, while other @wordpress/* packages that are likewise externalized at build time (data, preferences, notices, i18n) resolve fine. Suppress the rule on the single affected import with a comment explaining why.
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.
Summary
Adds an opt-in Editor preferences panel in the Create Block Theme sidebar with a single toggle that expands every typography control in the block inspector by default, instead of hiding them behind the ToolsPanel ellipsis menu. Intended for theme authors iterating on typography.
Fixes #823.
Why
Adjusting typography in the Site Editor takes two steps per control today: open the ellipsis menu, enable the control, then set the value. For theme authors iterating across many blocks and elements, this adds up. The issue has more context (#823), including the related upstream discussions in gutenberg#41376 and gutenberg#41544.
The narrow scope here — plugin-only, reversible by toggling off or deactivating CBT.
New files
src/editor-enhancements/expand-typography-controls.js— mapping table, pureexpandTypographyDefaults(), and ablocks.registerBlockTypefilter that populates__experimentalDefaultControlsbased on the typography supports the block already declares.src/editor-sidebar/editor-preferences-panel.js— new panel with a singleCheckboxControl. Toggle writes the preference, firescreateInfoNotice('Applying…'), and reloads the editor.src/test/expand-typography-controls.test.js— 13 unit tests for the pure mapping function (null/undefined, each support key,fontAppearancemerge, falsy filtering, full shape, key preservation) plus one mapping-table sanity check.Modified
src/plugin-sidebar.js— side-effect import of the filter at the top (so it registers before block registration),cogicon, menu item under/editor-preferences, newNavigatorScreen.readme.txt— one bullet under Description.Design decisions
blocks.registerBlockTypeonly fires at registration time. Auto-reload matches the pattern already used.create-block-theme, same store as existing save-panel preferences. It really is only helpful while authoring a theme.$pagenow === 'site-editor.php'inincludes/class-create-block-theme-editor-tools.php:19, so the filter doesn't load in the post editor. The help text notes this. Broader coverage (splitting the filter into its own unconditionally-enqueued script) is a plausible v2.Mapping source
Verified against
gutenberg/packages/block-editor/src/components/global-styles/typography-panel.jsontrunk.fontWeightandfontStylecollapse into a singlefontAppearancecontrol. If the__experimental*keys rename in core, onlyexpand-typography-controls.jsneeds to change.Open questions for reviewers
From issue #823:
Test plan
A Claude-assisted PR.
Here are a few visusal:
Video:
Screen.Recording.2026-04-24.at.11.19.26.mov