-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that custom block element styles in theme.json
are not ignored
#4174
Conversation
…both unit and integration.
@glendaviesnz @scruffian Would be great to get your reviews on this since you worked on the original code in WordPress/gutenberg#41446. I worked on test coverage first. Seeing them fail on 308066b but pass on d1dcd9d shows that the updated logic correctly fixes the underlying bug. |
This tested well for me. I added: "styles": {
"blocks": {
"core/quote": {
"elements": {
"cite": {
"color": {
"text": "blue",
"background": "yellow"
}
}
}
}
"coblocks/accordion": {
"elements": {
"h2": {
"color": {
"text": "red",
"background": "black"
}
}
}
}
and without this patch element styles for the core and custom block displayed in the editor, but only the core block element style showed in the frontend. With this patch applied both element styles displayed in the editor and frontend. Thanks for looking at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @felixarntz! LGTM 👍
Committed in https://core.trac.wordpress.org/changeset/56254 |
theme.json
path.wp_add_global_styles_for_blocks()
.Trac ticket: https://core.trac.wordpress.org/ticket/57868
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.