-
Notifications
You must be signed in to change notification settings - Fork 360
Blockbase: remove margin-top from first descendants of columns and groups #4436
Conversation
skatepark/sass/base/_text.scss
Outdated
@@ -1,4 +1,12 @@ | |||
// Text selection text color | |||
::selection { | |||
color: var(--wp--preset--color--background); | |||
} | |||
|
|||
.wp-block-column, .wp-block-group { |
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.
These styles might better belong if blockbase, but I'm not sure about this idea in general.
My reasoning for adding it is — I don't think that the first piece of text should have a top margin when contained in a column or group, because it ends up stacking if there is a padding declared. But maybe there is a better way of solving this.
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 not sure we would do this for every theme, it feels kind of opinionated, it makes sense for Skatepark because of the border but that's it. When I first saw the pattern using the border I was thinking about it having a block style even but this approach makes sense too, but just in the scope of this specific theme.
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.
... it makes sense for Skatepark because of the border but that's it.
Since Blockbase opts into border controls, there's a UI for users to create this bordered effect on any Group block though — using Blockbase or any of its children.
I don't love these rules (and I hope Gutenberg adds greater per-block margin controls so folks can manually fix this sort of thing in the editor), but I think if we add these, they should be in Blockbase.
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.
Also, putting them in Blockbase would mean more universal expectations around this behavior for our themes, and also would make it easier to strip this out if it's not needed in the future. (Or if we come up with a better solution)
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.
yeah, I see what you mean, I don't like it but I agree, and having it on Blockbase is easier to control and go back to it when it eventually can be done better. I just hope we don't have to do this too much, Blockbase is growing instead of shrinking.
I tinkered with this some more and am coming to a different conclusion — I don't think we should add these rules at all. My reasoning:
That leaves us with two options:
|
4bbe6a2
to
34fd79b
Compare
I agree that these rules should live in blockbase. I have removed the border rules from skatepark altogether, I agree that they should live in the pattern. |
2645a50
to
72f4aad
Compare
Hi @melchoyce — would you mind retesting with the markup you provided in #4412? To simplify my long winded comment above, we do not have a reliable way to add padding to groups with borders. Despite this, I think this PR is still an improvement. |
That's right. |
Cool. Let's merge this, and talk about this option more when @kjellr is back:
We should also consider bumping this issue upstream, if that's possible (I might be understanding the problem) |
Added an issue for this WordPress/gutenberg#34315 |
Changes proposed in this Pull Request:
This PR removes the top margin of first children of columns and groups. It started as an exploration to add a default padding to all groups with borders.
Related issue(s):
Helps with #4412