Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#65162 new defect (bug)

Button block has overly opinionated default styling

Reported by: jlwilz's profile jlwilz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.9.4
Component: Themes Keywords: reporter-feedback
Focuses: Cc:

Description

/wp-includes/theme.json, line 296

The fallback theme.json file in in WordPress core includes explicit values for button text and background colors. These are applied in front-end CSS, causing buttons to be styled with these colors even when neither the theme nor the user has selected a value. This is an overly opinionated default that, due to CSS specificity rules, also risks breaking existing themes in a way that is not easy to diagnose or remedy.

Change History (5)

#1 @dd32
5 weeks ago

  • Component changed from Formatting to Themes

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


5 weeks ago
#2

  • Keywords has-patch has-unit-tests added; needs-patch removed

#3 @sukhendu2002
5 weeks ago

  • Keywords has-patch has-unit-tests removed

#4 @poena
4 weeks ago

  • Keywords reporter-feedback added

Hi @jlwilz
Thank you for your suggestion.

There are no current plans to remove or update the defaults. Do you have a suggestion specifically about changing the specificity?

Like you already mentioned, the CSS was added to make sure that the elements are styled when neither the theme or the user adds styling.
This is to make sure that the button blocks are are accessible, and that they have a default style that is distinct from regular links.
The specificity is chosen so that it can be overwritten by the settings in the interface, and programmatically.

Pinging @aaronrobertshaw in case you have anything to add.

(I also want to add a note that changes to blocks, the block editor or theme.json need to be managed in the Gutenberg GitHub repository. Changes are tested in the plugin before they are merged into WordPress core.)

#5 @poena
4 weeks ago

  • Summary changed from /wp-includes/theme.json, line 296 to Button block has overly opinionated default styling
Note: See TracTickets for help on using tickets.