Skip to content

Instantly share code, notes, and snippets.

@neverything
Created July 15, 2024 09:21
Show Gist options
  • Save neverything/0fcffa3930310d92ad376ff8c41157e6 to your computer and use it in GitHub Desktop.
Save neverything/0fcffa3930310d92ad376ff8c41157e6 to your computer and use it in GitHub Desktop.
GenerateBlocks Accordion Block as Mega Menu in WordPress: https://silvanhagen.com/writing/wordpress-mega-menu-blocks
.navigation-overlay {
position: fixed;
top: 150px;
left: 0;
right: 0;
bottom: 0;
height: calc(100dvh - 150px);
max-width: 100% !important;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
padding-left: calc(50dvw - 600px);
padding-right: calc(50dvw - 600px);
z-index: 2;
}
.navigation-overlay > div {
box-shadow: rgba(0, 0, 0, 0.2) 0 8px 24px;
}
/**
* Additional styles for the Site and Block editor
*/
.is-root-container .gb-accordion__item:not(.has-child-selected) > .gb-container:not(.gb-accordion__toggle) {
display: none;
}
.is-root-container .gb-accordion__item.has-child-selected > .gb-container:not(.gb-accordion__toggle) {
display: block;
padding-left: 0;
padding-right: 0;
}
.editor-styles-wrapper .is-root-container .navigation-overlay {
top: 50px !important;
}
.editor-styles-wrapper .navigation-overlay > div {
max-width: none;
left: 50%;
top: 50px;
translate: -50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment