Skip to content

Backport: update theme.json to inherit button styles on frontend#9268

Closed
shrivastavanolo wants to merge 1 commit intoWordPress:trunkfrom
shrivastavanolo:backport/global-styles-for-button-element
Closed

Backport: update theme.json to inherit button styles on frontend#9268
shrivastavanolo wants to merge 1 commit intoWordPress:trunkfrom
shrivastavanolo:backport/global-styles-for-button-element

Conversation

@shrivastavanolo
Copy link
Copy Markdown

Part of: WordPress/gutenberg#60403
Backport for: WordPress/gutenberg#70676

The provided code change updates the theme.json file to include additional typography styles for button elements. Specifically, it adds "fontStyle", "fontWeight", "letterSpacing", and "textTransform" properties with a value of "inherit". This change aims to address an issue where these styles were not being applied to button elements, despite being set at the root level via Global Styles. The issue was reproducible by updating typography styles in the Site Editor and inserting a Search block, which did not display the expected styles on the front end.

Testing Instructions

  • Go to the Site Editor > Global Styles > Typography > Text > Typography panel
  • Update all styles.
  • Insert a Search block in a post and check if it's style is getting inherited on the front end.

Screenshots or screencast

Before

Screenshot 2025-07-10 at 3 11 07 PM

After

Screenshot 2025-07-10 at 3 11 20 PM

Trac ticket:
https://core.trac.wordpress.org/ticket/63700

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 15, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props shreya0shrivastava, getsyash.

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

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@getsyash
Copy link
Copy Markdown

Test Report

Description

This report validates whether the indicated patch works as expected.

PR tested: #9268

The patch updates the theme.json file to include additional typography styles (fontStyle, fontWeight, letterSpacing, textTransform) for button elements, all set to "inherit". This ensures buttons correctly inherit typography settings applied globally via Site Editor.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.29
  • Server: nginx/1.29.0
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 138.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  • Before patch:
Screenshot 2025-08-11 200024 - After patch: Screenshot 2025-08-11 200612

✅ Issue resolved. Buttons now correctly inherit all specified typography settings from the root level.

Additional Notes

  • Verified using the Search block as reproduction example.
  • No regressions or unexpected side effects observed.

pento pushed a commit that referenced this pull request Oct 21, 2025
This PR syncs the changes initially added to Gutenberg in WordPress/gutenberg#70676.

See #9268.
See https://core.trac.wordpress.org/ticket/63700.

Fixes #63700.

git-svn-id: https://develop.svn.wordpress.org/trunk@61021 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions
Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61021
GitHub commit: 891796d

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Oct 21, 2025
github-actions bot pushed a commit to platformsh/wordpress-performance that referenced this pull request Oct 21, 2025
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Oct 21, 2025
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.

2 participants