-
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
Revert "Fix: Remove unrequired margins from the columns block" #21824
Revert "Fix: Remove unrequired margins from the columns block" #21824
Conversation
This reverts commit 6c1355c.
Size Change: +36 B (0%) Total Size: 845 kB
ℹ️ View Unchanged
|
@@ -234,7 +234,7 @@ const ColumnsEdit = ( props ) => { | |||
} | |||
|
|||
return ( | |||
<Block.div> | |||
<Block.div className="has-placeholder"> |
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.
Instead of this class, can you target the placeholder component directly? Something like
[data-type="core/columns"] > .components-placeholder {
margin....
}
That would also allow us to avoid the :not selector below.
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.
I can try this, but the block would need to be aware of the variable. Is that ok?
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.
I'm missing some of the context here, so I don't want to give bad advace. In fact I'd defer to your self and @jorgefilipecosta on the technical details — it just seemed like an additional class felt too much. If it isn't, ignore me!
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.
Hi @ellatrix thank you for submitting a fix to the issue 👍
Now I understand why the margins are needed but making some tests in this PR I notice some undesired behaviors:
If add two columns block following each other I get the following result:
When I add two group blocks I get the following:
Should the consecutive columns look similar to the consecutive groups?
On the widgets screen with these changes, the block UI appears above the name of the widget area:
On the widgets screen, we lose the space between the columns block and the inserter:
All the cases happen when the columns already contains column blocks but the each column itself is empty.
@jasmussen Now I'm doubting if it should be done like this... because I see the following styles: // This is the style used on the front-end, which ideally should be loaded in
// the editor too.
.wp-block-column > *:first-child {
margin-top: 0 !important;
}
.wp-block-column > *:last-child {
margin-bottom: 0 !important;
} |
I created #22018 as an alternative, thanks Ella your last comment put me on that trail. What do you think? |
Reverts #21615
See #21615 (comment).
I added a commit here applying margins to the placeholder.