-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Reset margin for all children of flow layouts #35426
Conversation
Size Change: +23 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
yeah I forgot the root level, what about now? |
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.
Nice, works well for me now, and feels good to land since it's only the missing half of the full stack CSS equation. So I'm tempted to just give this the green check.
But I'm still not sure why it targets the site title wrapper (.edit-post-visual-editor__post-title-wrapper > *
) — it appears to do it in my theme, where I leverage the gap property, and it's causing the title block to have zero margin:
It's trivial for me to add that back in my editor style, but it seems like a bug it's there in the first place.
@jasmussen It does impact the post title, that's actually the result of applying the default layout to the post title wrapper. We do this in order to apply the right "max-width" to the post title. I'm not exactly sure how to solve that at the moment but let me try a few things |
I'm personally okay with the trade-off because it isn't really a "block" yet, and it's one of those things that would be solved if it actually became a block. The reason I mention it is because right now it behaves add it's own wrapper with a single child, followed by the post content wrapper with all it's paragraphs. Meaning there's no gap between title and post content. |
Maybe a better default would be to explicitly apply the "gap" variable as a margin-top and margin-bottom of the wrapper? (I mean hard-coded in Gutenberg codebase. WDYT |
If the gap is leveraged by the theme, yeah that might make sense. Basically I would ideally expect the editor (post title and a bunch of paragraphs) to look the same as a H1 followed by a bunch of paragraphs on the frontend. |
I pushed a fix let me know how it feels. |
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.
bfe053c
to
c593abb
Compare
closes #34441
Applies the suggestion in #34441 to reset the margin for all children of flow layouts. While the margin-top is applied to all but the first one (to space the children), the reset should apply to all children.