Site logo

Archived topic

(left) Hamburger menu / Centered logo / search (right)

9 replies · Started by Ezra on June 15, 2021

Viewing posts 1–10 of 10

I'd like to re-create this layout:

(left) Hamburger menu / Centered logo / search (right)

I've done some research, and came across this article which gets me halfway there, but not quite. Currently what I have works pretty good for mobile, but on desktop it's kinda crude. Clicking on the menu messes up the layout, and moves the search icon to the left. Ideally, clicking on the menu should just dropdown a little menu, just like the site in the illustration above does.

Thanks in advance!

Hi Ezra,

Try this CSS:

@media (min-width: 769px) {
    #site-navigation.toggled div#primary-menu {
        position: absolute;
        top: 54px;
        z-index: 999;
    }
}

Wow, perfect! Thanks so much! Another quick question: the search field jumps over to the left when I click the search button. How do I make it behave a little more naturally? I guess it's OK on mobile, but on the desktop it's a bit unhandy.

Are you trying to shorten the search field? If so, try this CSS:

form.search-form.navigation-search.nav-search-active {
    display: flex;
    justify-content: flex-end;
}
.navigation-search input[type="search"] {
    width: 300px;
}

Awesome, with a little tweaking that worked admirably! Thanks again! :)

Can I put in a feature request that GP apply some default styles to the search function? Currently, clicking the search icon brings up a blank white box with nothing to indicate that it's an input box other than a blinking cursor.

We'll definitely consider it if there're more similar requests :)

One more request for the menu. Is it possible to make the mobile menu close by clicking anywhere outside the menu? Currently, the only way to close the menu is to click directly above it on the "X MENU" button.

Any chance you can open a new topic for a separate question?

Thanks :)

Glad to hear :)

This archived topic is closed to new replies.