-
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
Refine the layer management of the Cover Block #39427
Comments
This is looking very cool, thanks for sharing the designs! I think a dedicated Background set of controls makes a lot of sense, along with tucking away the image controls in a popover 🎉 I have a couple of questions, thinking about the existing color controls in the cover block, and how we might use these controls in other blocks / a generalised background block support for the Group block and other container blocks (possibly Column?).
I totally understand of course if the goal at first is to see if we can improve the UI just for the cover block to begin with and expand from there. Very exciting work, indeed! |
Can you expand on this? I know there's a text/background control that appears if you select the Paragraph inside the cover block. But that's separate from the Cover itself, right?
This is a stumbling block we will run into in the future, absolutely, thanks for pointing it out. But I think we have some options:
As soon as opacity or gradients are used, contrast checkers become unable to validate or confirm sufficient contrast anyway. A potential solution I've seen discussed in context of this, was to output a generic warning message, such as "Be careful with transparency, contrast with text overlays might not be sufficient", something like that.
The ability to add layers is a bit forward-looking, but I've been thinking of this as a userfacing control handling the CSS for multiple backgrounds:
That's just a comma separated list of backgrounds, which could be media, gradients or solid colors. The caveat is: no opacity (unless RGBA is used inside the flyout), hence this possible concession. In that light, I don't see why a group block couldn't have "layers" as it were, it'd still be a single CSS value. But to answer more high level, it seems completely fine to start with the panel/itemgroup/flyout simplification, and then explore whether layers, including the locking down of the ability to add more layers, could come later on. What do you think? |
Ah, apologies, yes! I've been looking at the Group block too long, and was too quick in my testing. The Cover block indeed doesn't have color controls for text. Though, like with the Group block, maybe it'd be good to be able to cascade down a text color / link control. I suppose we'd like both blocks to be great and versatile container blocks that are a foundational part of designs, so having all those controls at your fingertips will be quite useful. And I see there's an open PR (#37783 and earlier #31370) already to add border support to the Cover block.
That's an interesting idea! Plus, I see in your screenshots you've added some headings under
I think this is possibly one of the trickier aspects for consistency across blocks. A separate Background panel makes good sense for Group or Cover blocks where we might want to have all the background and text color / link color options exposed. But for simpler blocks (like paragraph), it might be a bit overkill to have separate Background and Color panels? I think I quite like your idea of seeing if there can be a single panel with different groupings for Background vs Color, but I wonder what would make most sense as a collective name 🤔
Oh, that's awesome! Thanks, I didn't realise you could add multiple backgrounds in the one property like that, very neat. In that case, yes, looks like we could still have the layout concept there 😀
Yes, I agree — I think since this discussion has brought up lots of different options and considerations, exploring changes to the UI (starting with the Cover block) makes a lot of sense to me, and then iterating from there. My only concern with changes to the cover block, is when it comes to implementing new features and controls that change the markup. It's already quite a complex block with lots of deprecations, so when we get to implementing more layers, etc, it could be a good opportunity to explore a server-rendered block support (that doesn't update the saved post content in the database), to side-step adding too much extra complexity to that one block (while also opening up the potential for server-rendered values like feature post image). But that's probably more of a consideration for when we have a better idea of how those features should land. Thanks for all the discussion points! |
Awesome feedback. I'd love to be pinged on any work on this (and @javierarce too I'm sure), I definitely think we can implement pieces in a very incremental way, such as:
After that, we can explore what merging of itemgroups, or what multiple-background-layer we mean to add on top of this. I think the ItemGroup can be a key interface to explore the boundaries of, especially with an eye towards #39281 which might or might not collapse child properties into a single panel depending on how that moves forward. #39452 also explores how the same ItemGroup can be used for when you want to add multiple filters to a single image, such as both Duotone and Dithering. |
Thanks for the exploration, @javierarce . Just to connect some dots, this design direction would supersede #20837, wouldn't it? |
I still think there's value in surfacing the first overlay as a color option in the block toolbar, as it'll likely be useful in 80% of the cases. If you want any additional layers, it's okay to do that in the inspector. Do you foresee any additional complications between the two? |
@priethor I agree with @jasmussen that, for the general use case where you have a solid layer (or a solid layer plus a media layer), it'll be helpful to have a way to change the main overlay from the toolbar… but if you happen to have more than two colors, it could end up being confusing: which color should the toolbar control? The one closer to the bottom of the stack or the one on top? And things will get messier if we allow ordering layers. Since removing a feature from users is always a point of friction, I personally wouldn't add the color control in the toolbar of this block. |
Just a quick thought... |
I don't think so… at least my idea was to use the type of media as the name for the layer, so if you add a video, then the layer will be called Video. On my first exploration, I also called the layer Media initially when the layer doesn't have any content. |
This issue describes a set of refinements for the Cover Block layer management and some ideas for further improvements that @jasmussen and I have worked on. Our explorations and designs for this issue are also available on this Figma file.
The core idea is to group all the layers (both overlays and media layer) inside a single sidebar section called Background, abstracting the organization of the Cover Block layers on the canvas and simplifying the block sidebar.
On this issue, we’ll share a vision for a potential first implementation and a list of refinements for the future.
Here’s what the layer management could look like:
The sidebar contains a list of items sorted by the position of the layers in the canvas.
Each layer item now includes:
As with color management, we placed the settings of the media layer inside of a popover. This will reduce the overall number of elements in the sidebar and will allow users to adjust the media properties in a more focused way.
Since the media layer is central to the Cover Block, clicking the minus sign won’t remove the item from the list. Instead, we’ll return the item to its initial empty state.
Adding a photo or a video is also managed from a popover:
Clicking the popover placeholder will open the system file picker, but we could also allow dragging an image as we do with the featured images.
The logic for adding overlays on top of the media layer could work as follows:
When adding layers, we prioritize speed, so instead of giving users the option to choose between a solid, a gradient, or a pattern; clicking the plus symbol will immediately add a solid layer with some opacity (a good default could be 50% black).
Clicking the plus button several times will add new solid layers. Ideally, we’ll insert a random color from the theme color palette (it would be cool to avoid repeating colors, but that logic could be hard to implement). Other more simple options could be: adding the default 50% black solid layer or repeating the last inserted item. On this initial exploration, we don’t envision allowing users to reorder their layers. However, users will be able to organize them by updating their properties or removing and adding new ones.
Future layer management
Looking at the future of layer management for this and other blocks, we believe it could look like this:
Explorations and designs for this issue are available on this Figma file.
Related discussions and issues:
The text was updated successfully, but these errors were encountered: