Skip to content

Remove repeated button styles from theme.json - #235

Merged
MaggieCabrera merged 1 commit into
trunkfrom
update/theme-json-button-states
Nov 16, 2026
Merged

MaggieCabrera merged 1 commit into
trunkfrom
update/theme-json-button-states

Conversation

@juanfra

@juanfra juanfra commented Nov 13, 2026

Copy link
Copy Markdown
Member

Description

theme.json set the same button styles in several places. This removes the copies that never apply and writes the four-sided borders as one value. Nothing changes visually.

  • :focus-visible is gone from elements.button, core/button and the outline variation. Anything that matches :focus-visible also matches :focus, which sets the same outline or border.
  • core/button no longer repeats the :hover, :active and :focus colors from elements.button. It keeps its dotted :focus border, because its own solid border would otherwise win.
  • The button border, the outline variation border and both dotted focus borders use "border": { "color", "style", "width" } instead of the same value on four sides, and the button radius is one value. In Styles › Blocks › Button, the border and radius now show as single linked controls.
  • The outline variation drops its copied letterSpacing. It keeps its own :active and :focus colors, border and padding, because core's is-style-outline CSS overrides them otherwise.
  • The Search button drops its fontFamily. Core's button element inherits the font, and the Search block already sets Manrope, so the button stays in Manrope in every style variation. The one difference: a font chosen for the Search block in Styles › Blocks › Search now reaches its button too, where before the button kept Manrope.

Screenshots

1-default-before 2-after-hours-after 3-default-focus-fill-after

Testing Instructions

  1. Add a Buttons block with a Fill and an Outline button, and a Search block with a text button.

    Block markup
    <!-- wp:buttons -->
    <div class="wp-block-buttons"><!-- wp:button -->
    <div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#">Fill button</a></div>
    <!-- /wp:button -->
    
    <!-- wp:button {"className":"is-style-outline"} -->
    <div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="#">Outline button</a></div>
    <!-- /wp:button --></div>
    <!-- /wp:buttons -->
    
    <!-- wp:search {"label":"Search","buttonText":"Search"} /-->
  2. Compare each button with trunk at rest, on hover, on focus (Tab to it) and while pressed. The colors, the dotted focus border and outline, the corners and the fonts are the same.

  3. Repeat in the post editor, and with a dark variation such as After Hours.

  4. In the Site Editor, open Styles › Blocks › Button. Border shows one linked 1px value and Radius one linked 10px value.

I checked this on WordPress 7.2-beta3 with Gutenberg 24.3.1, on a page with every button the theme uses: the Buttons in its patterns (with their own colors, borders, widths and radius), all six Search setups including the Outline style, the File and comment form buttons, and buttons with custom colors, a gradient, a custom border, large text, 50% width and on an inverted section. I compared 36 computed properties of each button in six states (rest, hover, focus, focus-visible, pressed, hover and focus) with trunk, on the front end and in the post editor, with the default style and each of the seven color and five typography variations. All 26 runs match. I also compared the generated global styles, where only the removed and single-value lines change. npm run lint:theme and npm run lint:css pass.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Making the change, comparing output against trunk, and drafting this description.

Drop the :focus-visible rules that repeat :focus, the core/button colors that repeat elements.button, the outline variation's copied letterSpacing and the Search button's fontFamily, and write the four-sided button borders and radius as single values. Nothing changes visually.
@github-actions github-actions Bot added the [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: juanfra <juanfra@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@juanfra juanfra added the [Type] Enhancement A suggestion for improvement. label Nov 13, 2026
@MaggieCabrera
MaggieCabrera merged commit 04d71a2 into trunk Nov 16, 2026
9 checks passed
@MaggieCabrera
MaggieCabrera deleted the update/theme-json-button-states branch November 16, 2026 10:53
MaggieCabrera added a commit to MaggieCabrera/wordpress-develop that referenced this pull request Nov 16, 2026
Removes button styles that were set in several places but never applied, and writes the four-sided borders and the radius as single values. Nothing changes visually, and Styles shows the button border and radius as single linked controls.

Synced from WordPress/ipsum#235.

See #66678.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Nov 17, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e

- Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216)
- Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203)
- Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200)
- Improve design guide defaults and schema descriptions (WordPress/ipsum#193)
- Make the short post date format translatable (WordPress/ipsum#224)
- Fix Details block markers being announced by screen readers (WordPress/ipsum#230)
- Remove the physical left alignment from the page patterns (WordPress/ipsum#226)
- Indent the navigation submenus on the inline start (WordPress/ipsum#225)
- Fix accessible names for overlay navigation (WordPress/ipsum#228)
- Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214)
- Use a logical margin for the comment form checkbox (WordPress/ipsum#231)
- Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145)
- Fix accessible name of overlay search form (WordPress/ipsum#239)
- Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238)
- Keep the post date on one line when categories wrap (WordPress/ipsum#205)
- Remove repeated button styles from theme.json (WordPress/ipsum#235)
- Remove unused values from theme.json (WordPress/ipsum#237)
- Make the credit line URL translatable (WordPress/ipsum#240)
- Use single border radius values in theme.json (WordPress/ipsum#236)
- Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245)
- Use the Site Title in Footer Centered (WordPress/ipsum#244)
- Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247)
- Treat "Written by" as a label before the author name (WordPress/ipsum#246)
- Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232)
  

This commit also includes changes that only exist in core:

- Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles.
- `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`.
- A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match".

Developed in: #15948

Follow-up to r65366.

Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi.
Fixes #66678. See #66352.

git-svn-id: https://develop.svn.wordpress.org/trunk@65549 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 17, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e

- Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216)
- Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203)
- Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200)
- Improve design guide defaults and schema descriptions (WordPress/ipsum#193)
- Make the short post date format translatable (WordPress/ipsum#224)
- Fix Details block markers being announced by screen readers (WordPress/ipsum#230)
- Remove the physical left alignment from the page patterns (WordPress/ipsum#226)
- Indent the navigation submenus on the inline start (WordPress/ipsum#225)
- Fix accessible names for overlay navigation (WordPress/ipsum#228)
- Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214)
- Use a logical margin for the comment form checkbox (WordPress/ipsum#231)
- Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145)
- Fix accessible name of overlay search form (WordPress/ipsum#239)
- Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238)
- Keep the post date on one line when categories wrap (WordPress/ipsum#205)
- Remove repeated button styles from theme.json (WordPress/ipsum#235)
- Remove unused values from theme.json (WordPress/ipsum#237)
- Make the credit line URL translatable (WordPress/ipsum#240)
- Use single border radius values in theme.json (WordPress/ipsum#236)
- Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245)
- Use the Site Title in Footer Centered (WordPress/ipsum#244)
- Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247)
- Treat "Written by" as a label before the author name (WordPress/ipsum#246)
- Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232)
  

This commit also includes changes that only exist in core:

- Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles.
- `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`.
- A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match".

Developed in: WordPress/wordpress-develop#15948

Follow-up to r65366.

Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi.
Fixes #66678. See #66352.
Built from https://develop.svn.wordpress.org/trunk@65549


git-svn-id: http://core.svn.wordpress.org/trunk@64622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e

- Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216)
- Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203)
- Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200)
- Improve design guide defaults and schema descriptions (WordPress/ipsum#193)
- Make the short post date format translatable (WordPress/ipsum#224)
- Fix Details block markers being announced by screen readers (WordPress/ipsum#230)
- Remove the physical left alignment from the page patterns (WordPress/ipsum#226)
- Indent the navigation submenus on the inline start (WordPress/ipsum#225)
- Fix accessible names for overlay navigation (WordPress/ipsum#228)
- Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214)
- Use a logical margin for the comment form checkbox (WordPress/ipsum#231)
- Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145)
- Fix accessible name of overlay search form (WordPress/ipsum#239)
- Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238)
- Keep the post date on one line when categories wrap (WordPress/ipsum#205)
- Remove repeated button styles from theme.json (WordPress/ipsum#235)
- Remove unused values from theme.json (WordPress/ipsum#237)
- Make the credit line URL translatable (WordPress/ipsum#240)
- Use single border radius values in theme.json (WordPress/ipsum#236)
- Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245)
- Use the Site Title in Footer Centered (WordPress/ipsum#244)
- Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247)
- Treat "Written by" as a label before the author name (WordPress/ipsum#246)
- Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232)
  

This commit also includes changes that only exist in core:

- Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles.
- `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`.
- A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match".

Developed in: WordPress#15948

Follow-up to r65366.

Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi.
Fixes #66678. See #66352.

git-svn-id: https://develop.svn.wordpress.org/trunk@65549 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants