Skip to content
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

Page List & Navigation Screen: Fix flyout bg color in page list. #29932

Merged
merged 1 commit into from Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/block-library/src/navigation-link/style.scss
Expand Up @@ -84,9 +84,10 @@
}
}

// Default background and font color
.wp-block-navigation:not(.has-background) .wp-block-navigation__container {
.wp-block-navigation-link__container {
// Default background and font color.
.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 {
// Set a background color for submenus so that they're not transparent.
// NOTE TO DEVS - if refactoring this code, please double-check that
// submenus have a default background color, this feature has regressed
Expand Down
7 changes: 0 additions & 7 deletions packages/block-library/src/page-list/editor.scss
Expand Up @@ -4,13 +4,6 @@
.wp-block-page-list {
background-color: inherit;
}
// Make the dropdown background white if there's no background color set.
&:not(.has-background) {
.submenu-container {
color: $gray-900;
background-color: $white;
}
}
}

// Make links unclickable in the editor
Expand Down
12 changes: 9 additions & 3 deletions packages/block-library/src/page-list/style.scss
Expand Up @@ -13,12 +13,14 @@
}
}

// The Pages block should inherit navigation styles when nested within it
// The Page List block should inherit navigation styles when nested within it
.wp-block-navigation {
.wp-block-page-list {
display: flex;
flex-wrap: wrap;
background-color: inherit;
}

.wp-block-pages-list__item__link {
display: block;
color: inherit;
Expand All @@ -33,10 +35,9 @@
> a {
padding-right: 0.5em;
}

> .submenu-container {
border: $border-width solid rgba(0, 0, 0, 0.15);
background-color: inherit;
color: inherit;
position: absolute;
left: 0;
top: 100%;
Expand Down Expand Up @@ -91,6 +92,11 @@
}
}

&.has-background .wp-block-pages-list__item.has-child > .submenu-container {
background-color: inherit;
color: inherit;
}

.submenu-container {
padding: 0;
}
Expand Down