-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Post Content: adding pseudo states + typography breaks block margin #43955
Copy link
Copy link
Closed
Labels
[Block] Post ContentAffects the Post Content BlockAffects the Post Content Block[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
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 |
|---|---|
![]() |
![]() |
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Block] Post ContentAffects the Post Content BlockAffects the Post Content Block[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.

