Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a rounded corners block style to the Image and Gallery blocks #16949
This PR adds a simple "Rounded Corners" block style to the Image and Gallery blocks. This seems like something we might as well include, separately from the effort in #16130. I went with
requested review from
Aug 7, 2019
mapk left a comment
The block itself and output work great!
I double checked the style variation previews and on the individual Image block, they're perfect.
But on the Gallery block style variations, they looked a bit weird.
I'm not sure how to get around that one because I believe the Preview just pulls the same styles as the block.
This actually echoes a challenge we have with adding features to the separator variations. The gist is that because themes can (and should if they'd like to) override the individual variations, whatever user-customizable style features we add in addition the variations should probably be generic to the block itself. I.e. if we were to add a border radius handle, it should probably be block level and not variation specific.
That brings me to a question to you Kjell: this 8px radius is easily overridable by themes, right? For instance if I had a theme where I use a small 4px radius for many buttons, I might want the rounded corner variation to have the same.
The new preview that was JUST MERGED should fix this right up, I believe!
Yeah, it's just a class — so it's just as overridable as the button styles are.
I understand this, but I also wonder if it makes things too granular for users? Oh a high level, rounded corners feel like a "style" change, so the "Styles" panel seems like the right place to look for it.
The non-boolean aspect of this is the radius, right? And moving out of Block Styles would afford us the ability to let users fine-tune the rounded corner radius. But I'm not totally sure that's important to do at a per-block level. Like some of the recent separator block work, I wonder if those fine-tuned settings make more sense as global settings (once we have a place for them).
In any case, I've never been 100% clear on when to use Block Styles or not, so I'm all for developing some better guidelines for them — it seems like the previous guidance was largely just "Can it be done with only CSS? Then it can be a Block Style."