Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#65162 new defect (bug)

Button block has overly opinionated default styling

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

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
4 months ago

  • Component FormattingThemes

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


4 months ago
#2

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

#3 @sukhendu2002
4 months ago

  • Keywords has-patch has-unit-tests removed

#4 @poena
4 months 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 months ago

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