Make WordPress Core

Opened 4 months ago

Closed 3 weeks ago

#63700 closed defect (bug) (fixed)

Backport Global Styles: Make Button element inherit all typography styles on the frontend

Reported by: shreya0shrivastava's profile shreya0shrivastava Owned by: ellatrix's profile ellatrix
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-test-info dev-reviewed commit gutenberg-merge
Focuses: Cc:

Description

Buttons with the wp-element-button class are missing key typography styles—font-style, text-transform, letter-spacing, and font-weight—on the frontend, even when these are defined at the root level in Global Styles.

Steps to Reproduce:

  1. Activate Emptytheme (or a theme where button styles aren't overridden).
  2. Go to Site Editor → Global Styles → Typography → Text → Update all styles.
  3. Insert a Search block.
  4. Check the frontend — the above styles are not applied to the button.

Expected:
Styles should match what’s shown in the editor.

Actual:
Styles like font-style and font-weight are missing on the frontend.

Change History (13)

#1 in reply to: ↑ description @shreya0shrivastava
4 months ago

Replying to shreya0shrivastava:

Buttons with the wp-element-button class are missing key typography styles—font-style, text-transform, letter-spacing, and font-weight—on the frontend, even when these are defined at the root level in Global Styles.

Related Gutenburg issue: https://github.com/WordPress/gutenberg/issues/60403

This ticket was mentioned in PR #9268 on WordPress/wordpress-develop by @shreya0shrivastava.


4 months ago
#2

  • Keywords has-patch added

Part of: https://github.com/WordPress/gutenberg/issues/60403
Backport for: https://github.com/WordPress/gutenberg/pull/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

https://github.com/user-attachments/assets/283640ff-e53b-40a3-be0f-127c03bb3fde

### After

https://github.com/user-attachments/assets/22b52e1e-033c-4f54-b502-c6986be62563

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

#3 @wildworks
4 months ago

  • Keywords dev-reviewed has-test-info added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The patch is working fine, see this comment for testing instructions.

The Gutenberg PR has already been merged, and it would be great if the core patch is also committed by 6.9.

#4 @wildworks
4 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#5 @wildworks
4 months ago

  • Milestone set to 6.9

#6 @SirLouen
3 months ago

  • Keywords needs-testing added

This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.


3 months ago

@getsyash commented on PR #9268:


3 months ago
#8

## Test Report
### Description
This report validates whether the indicated patch works as expected.

PR tested: https://github.com/WordPress/wordpress-develop/pull/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:

https://github.com/user-attachments/assets/8ada72cf-6af2-412c-bb77-ad5c8adb9000

  • After patch:

https://github.com/user-attachments/assets/2401c9a5-f777-46d5-8101-a380a91a1a6b

✅ 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.

#9 @SirLouen
3 months ago

  • Keywords needs-testing removed

#10 @rollybueno
3 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/9268

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 139.0.0.0
  • OS: Linux
  • Theme: A Minimum Theme 1.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • Tested by creating a custom FSE theme with minimum files required to activate.

Supplemental Artifacts

Before:
https://i.imgur.com/OmLsJ4A.png
After:
https://i.imgur.com/9NReob4.png

#11 @wildworks
4 weeks ago

  • Keywords commit gutenberg-merge added

I think the patch is ready to be committed.

This ticket was mentioned in Slack in #core-editor by ella. View the logs.


3 weeks ago

#13 @ellatrix
3 weeks ago

  • Owner set to ellatrix
  • Resolution set to fixed
  • Status changed from reopened to closed

In 61021:

Global styles: inherit all typography styles.

This PR syncs the changes initially added to Gutenberg in https://github.com/WordPress/gutenberg/pull/70676.

See https://github.com/WordPress/wordpress-develop/pull/9268.
See https://core.trac.wordpress.org/ticket/63700.

Fixes #63700.

Note: See TracTickets for help on using tickets.