Closed mrwweb closed 3 years ago
@mrwweb I generally want the button to align to the bottom on card layouts like this. Would it make more sense to make this a group
so you could use it on any element? I understand that would add complexity to creating it for the editor. Or apply this style to button, link, paragraph, etc?
On a technical side, how do we implement this? Does this depend on the #11 so the parent column is display: flex;
? Then add 'justify-self: flex-end;
to the button? My flexbox knowledge isn't 100%, so I could be missing something.
Demo: https://codepen.io/mrwweb/pen/eYgmypR?editors=1100
auto margin + flexbox is the best-kept flexbox secret.
@mrwweb looks great! Any thought to applying this to a Group?
My thought: Apply to Button, paragraph (so it could be applied to a non-button link), and group (for ultimate flexibility).
I could be persuaded to only do Button if we want to keep the complexity/technical debt down.
I think this would have to be applied to the core/columns
block, because it needs to set styles of both the core/column
wrapper and the last block in the column. The alternative would be to create multiple styles that would have to be combined to make it work and might be a little more unpredictable. I do like the idea of a way to make it apply to more than just buttons though. This is an interesting one. It might be worth sketching out in a branch for feedback.
Emerging guidelines for this plugin: "stick to styles that are useful utility classes (small, single purpose) and mostly for Text blocks."
Therefore, closing this issue.
Because column blocks are already equal-height, it's pretty easy to write a rule that forces a button block to align to the bottom of any column.
Questions: