Skip to content
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

Elements heading styles are not applied in the Site Editor #42177

Closed
carolinan opened this issue Jul 6, 2022 · 2 comments · Fixed by #42479
Closed

Elements heading styles are not applied in the Site Editor #42177

carolinan opened this issue Jul 6, 2022 · 2 comments · Fixed by #42479
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@carolinan
Copy link
Contributor

Description

When applying styles to elements.heading (as opposed to elements.h1 etc), the styles are applied on the front and in the block editor, but not in the Site Editor.

Step-by-step reproduction instructions

  1. Activate Gutenberg trunk
  2. Activate a full site editing theme, for example emptytheme.
  3. In theme.json, add:
"styles": {
	"elements": {
		"heading": {
			"color": {
				"text":"white",
				"background": "blue"
			}
		}
	}
}
  1. In theme.json, also delete any other styling to heading blocks.
  2. Go to the site editor and add a few heading blocks of different level. Do not change any color options.
  3. Confirm that the blocks do not have the colors you added in theme.json.
  4. Save and view the front of the website. Confirm that the colors are used. Optionally view source to see that the style is added:
h1, h2, h3, h4, h5, h6 {
    background-color: blue;
    color: white;
}
  1. Optionally, add a few heading blocks in the block editor and confirm that the colors are visible.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.0
Gutenberg current trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano
Copy link
Contributor

I have confirmed that the same problem occurs in the caption element as well as the button block.
I believe #42479 will solve the problem 👍

Repository owner moved this from Issues Created to Done in Ignite Build a Theme Jul 20, 2022
@bgardner
Copy link

@t-hamano Circling back to confirm that #42479 solves the issue with captions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants