From ec572216a153cbcd22cfb67bd0358c2b3353b4f2 Mon Sep 17 00:00:00 2001 From: jasmussen Date: Wed, 14 Apr 2021 11:59:25 +0200 Subject: [PATCH] Try: Provide a baseline submenu background color. --- packages/block-library/src/navigation-link/style.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/block-library/src/navigation-link/style.scss b/packages/block-library/src/navigation-link/style.scss index eefef7bbb41bf..5dbe262a6de23 100644 --- a/packages/block-library/src/navigation-link/style.scss +++ b/packages/block-library/src/navigation-link/style.scss @@ -205,6 +205,10 @@ } // Default background and font color. +// This includes blocks that have a background color, +// as you might switch themes and the color specified is no longer registered. +// But when one is explicitly chosen after the fact, it will override these rules. +.wp-block-navigation.has-background, .wp-block-navigation:not(.has-background) { .submenu-container, // This target items created by the Page List block. .wp-block-navigation__container .wp-block-navigation-link__container { @@ -214,6 +218,13 @@ // several times, so care needs to be taken. background-color: #fff; color: #000; + } +} + +// Paint a border only when we know for sure that the block doesn't have a working background color. +.wp-block-navigation:not(.has-background) { + .submenu-container, + .wp-block-navigation__container .wp-block-navigation-link__container { border: 1px solid rgba(0, 0, 0, 0.15); .submenu-container,