Opened 5 weeks ago
Last modified 4 weeks ago
#65162 new defect (bug)
Button block has overly opinionated default styling
| Reported by: |
|
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)
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
#4
@
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.)
Trac ticket: https://core.trac.wordpress.org/ticket/65162