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

Post Content: adding pseudo states + typography breaks block margin #43955

Closed
jffng opened this issue Sep 7, 2022 · 1 comment
Closed

Post Content: adding pseudo states + typography breaks block margin #43955

jffng opened this issue Sep 7, 2022 · 1 comment
Labels
[Block] Post Content Affects the Post Content Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended

Comments

@jffng
Copy link
Contributor

jffng commented Sep 7, 2022

Description

Adding a pseudo state + typography config to post content in theme.json breaks the block margin — this specifically happens when styles.blocks.core/post-content.elements.link.:hover.typography and any of the following properties are configured:

fontWeight, fontSize, fontStyle

I found that property is applied correctly, but the block margin breaks. There may be more combinations but that's what I discovered in my testing.

Step-by-step reproduction instructions

Add this CSS to your theme.json.

	"styles": {
		"blocks": {
			"core/post-content": {
				"elements": {
					"link": {
						":hover": {
							"typography": {
								"fontStyle": "italic"
							}
						}
					}
				}
			}
		}
	}

Or checkout this PR for emptytheme: WordPress/theme-experiments#309

Verify the margin-block-start breaks (is not parsed correctly?).

Screenshots, screen recording, code snippet

Before After
Screen Shot 2022-09-07 at 10 50 37 AM Screen Shot 2022-09-07 at 10 53 56 AM

Environment info

  • Gutenberg trunk
  • MacOS 12.2
  • Chrome, Safari

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

@jffng jffng added [Type] Bug An existing feature does not function as intended [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Block] Post Content Affects the Post Content Block labels Sep 7, 2022
@jffng
Copy link
Contributor Author

jffng commented Sep 13, 2022

Fixed by #43925

@jffng jffng closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant