Created
July 15, 2024 09:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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