Skip to content

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

@jffng

Description

@jffng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Post ContentAffects the Post Content Block[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions