Site logo

[Resolved] Off-Canvas Menu Item and Menu width

Home Forums Support [Resolved] Off-Canvas Menu Item and Menu width

Home Forums Support Off-Canvas Menu Item and Menu width

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2289465
    Torsten

    Hi,
    could you help me style my Off-Canvas menu?
    The menu items are really long, therefore I need to adjust the width of the slide-out-off-Canvas Menu, maybe set to 75% for mobile and tablet and 35% for Desktop.
    Code appreciated…

    I have an additional menu item left of the hamburger menu “Impressum” and can’t get rid of it

    .main-navigation .main-nav ul li a {
        display: none !important;
    }

    makes the whole menu invisible in the off-canvas menu as well…
    😉
    Thanks ahead,
    Torsten

    #2289486
    David
    Staff
    Customer Support

    Hi there,

    try this CSS:

    /* desktop width */
    :root {
        --slideout-width: 40vw;
    }
    /* small device width */
    @media(max-width: 768px) {
        :root {
            --slideout-width: 70vw;
        }
    }
    
    #generate-slideout-menu.main-navigation.offside {
        width: var(--slideout-width);
    }
    
    #generate-slideout-menu.main-navigation.offside--left {
        left: calc(-1 * var(--slideout-width));
    }
    
    #generate-slideout-menu.main-navigation.offside--left.is-open {
        transform: translate3d(var(--slideout-width), 0, 0);
    }

    NOTE: at the top of the code we load the --slideout-width variable. First value is for Desktop and second value is for mobile.
    Adjust the 40 and 70 to suit. The vw unit is % of the viewport width.

    #2289491
    Torsten

    lovely!

    still the “Impressum” in the menu and, just noticed, no Hamburger-Menu on mobile.
    Thanks,
    Torsten

    #2289500
    David
    Staff
    Customer Support

    If you edit the Menu in Appearance > Menus – can you see the Impressum menu item ?

    Missing mobile menu – in Customizer > Layout > Primary Navigation what is the Mobile Menu Breakpoint set to ?

    #2289519
    Torsten

    N°1:
    no – only the items displayed in the Off-Canvas Menu

    N°2:
    was “o”, now “768”

    😉

    #2289543
    David
    Staff
    Customer Support

    Options:

    a. create a new menu with NO MENU items, and assign its location to the Primary Navigation, this should leave just the off canvas

    OR

    b. increase the mobile menu breakpoint to a really hight value like 10000 ( you will need to type into the field ) so it always displays the mobile header

    #2289564
    Torsten

    this dirty trick helped.
    Wonderful, love it.
    best,
    Torsten

    #2289569
    David
    Staff
    Customer Support

    Haha – glad to be of help!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.