Opened 3 weeks ago
Last modified 3 weeks ago
#65899 new enhancement
Backport: add support for label element on the elements API
| Reported by: | sarthaknagoshe2002 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Themes | Version: | |
| Severity: | normal | Keywords: | has-patch gutenberg-merge |
| Cc: | Focuses: |
Description
Backport for https://github.com/WordPress/gutenberg/pull/81160
What?
Part of https://github.com/WordPress/gutenberg/issues/34198
This PR adds elements support to the label element.
Why?
So a theme can consistently style how form labels look across the site, regardless of the blocks or third party plugins used. This continues the form elements work recently done for inputs and selects.
How?
By allowing styling of label using the elements API
Testing Instructions
- Add the following to theme.json file:
"styles": {
"elements": {
"label": {
"color": {
"text": "red",
"background": "blue"
},
"spacing": {
"padding": {
"top": "25px",
"bottom": "25px",
"left": "25px",
"right": "25px"
}
}
}
}
},
- Insert a Custom HTML block with <label>Test Label</label> and verify the colors applied correctly in the editor and on the frontend.
Screenshots or screencast
| Trunk | This PR with theme.json changes | This PR with no theme.json changes |
Change History (2)
This ticket was mentioned in PR #13105 on WordPress/wordpress-develop by @sarthaknagoshe2002.
3 weeks ago
#1
#2
@
3 weeks ago
- Keywords gutenberg-merge added
- Milestone 7.1 → 7.2
Since the pull request https://github.com/WordPress/gutenberg/pull/81160 has not yet been merged, I believe the milestone should be 7.2, not 7.1.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/65899
Backport for: https://github.com/WordPress/gutenberg/pull/81160