Gutenberg: [ Navigation block ] Add transparent background for main block

Created on 13 May 2020  路  6Comments  路  Source: WordPress/gutenberg

When a user adds a Nav block to their Header (in the near future), they'll likely add the Nav block on top of a solid color Header. It is also likely they'll want the background color of the Header to show through the Navigation block. I foresee this being a highly common experience based on web patterns out there.

Now, any elements that are z-indexed on top of the Nav block (ie. submenus) should definitely have a background color. I'm totally in favor of this, because it feels like this is the only time where we experience a z-indexing issue of content on top of other content.

Here's a quick diagram to help communicate my direction.

81745906-78a0e800-945a-11ea-8e10-b91917dd4049

The user can always add a background color to the block with the Color Settings.

cc @mapk

Needs Dev [Block] Navigation [Type] Enhancement

Most helpful comment

Maybe they could be just removed.

Yes, that would be preferable. These two styles don't provide any special functionality over color settings already available for navigation block.

All 6 comments

Good idea Andrei @mapk

I totally agree. Top menu items do not need a menu background color. As it would inherit the header background color. (Can add a color in the sidebar.)

Sub menu items do need a background color. If the submenu overlaps content below the sub menu (without it having a background color) items/links would get mixed in with the content below. Having a background color to start out with avoids the messiness of overlapping content below the menu. (Can change the background color in the sidebar.)

Thanks for creating an issue, @draganescu!

One of the challenges here is figuring out how the style preview should look like:

Zrzut ekranu 2020-06-9 o 13 13 04

...that is, if these styles still make sense once the toolbar is transparent by default. Maybe they could be just removed.

Maybe they could be just removed.

Yes, that would be preferable. These two styles don't provide any special functionality over color settings already available for navigation block.

I second (third?) the removal of these styles. 馃槃

Was this page helpful?
0 / 5 - 0 ratings