.dokuwiki > nav.notos ul { display: flex; flex-wrap: wrap; list-style: none; margin: 1rem 0 0 0; padding: 0; li { padding: 0; margin: 0; box-sizing: border-box; } &.navtabs { span.curid, a { display: block; height: 100%; width: 100%; text-align: center; box-sizing: border-box; } a { padding: 0.5rem; } li.primary { flex-grow: 1; display: flex; justify-content: center; align-items: center; position: relative; border-right: 1px solid @ini_border; border-bottom: 1px solid @ini_border; &.active { a { color: @ini_highlight; } border-bottom: none; background-color: @ini_background; } &:hover { background-color: @ini_accent; } a { font-weight: bold; &:hover { color: unset; } } span.opener { display: none; // only visible in mobile } } li.secondary { display: none; &.active { // move to end and put in new line: order: 9999; flex: 0 0 100%; display: flex; } ul { width: 100%; flex-wrap: wrap; background-color: @ini_background; li { flex: 1 1 8rem; padding: 0.5rem 1rem; text-align: center; border-radius: 5px; &:hover { background-color: @ini_accent; a { color: unset; } } } } } li:last-child, li:nth-last-child(2) { border-right: none; } } } // mobile toggle mechanism on desktop .dokuwiki > nav.notos { label { display: none; } input { display: none; } } @media screen and (max-width: @ini_phone_width) { @menu-pos-x: 1rem; @menu-pos-y: -4rem; // mobile menu .dokuwiki > nav.notos { position: relative; ul.navtabs { position: absolute; left: @menu-pos-x; top: @menu-pos-y; width: 90vw; z-index: 100; background-color: @ini_header_text; box-shadow: 5px 5px 10px 0 rgba(0, 0, 0, 0.5); padding-top: 3rem; // space for menu button margin: 0; flex-direction: column; border-bottom: 1px solid @ini_border; li.primary { border: none; border-top: 1px solid @ini_border; span.opener { display: block; position: absolute; top: 0.25rem; right: 0.25rem; cursor: pointer; svg { width: 1.5em; height: 1.5em; fill: @ini_text; } } // we only open, but don't close &.active span.opener { display: none; } } li.secondary { &.active { order: unset; } ul { margin: 0; li { text-align: left; flex: 1 1 40%; } } } } } // mobile toggle mechanism .dokuwiki > nav.notos { label { position: absolute; left: @menu-pos-x; top: @menu-pos-y; z-index: 105; // above the menu display: block; cursor: pointer; svg { width: 3rem; height: 3rem; } .open { display: block; svg { fill: @ini_header_text; } } .close { display: none; } } input:checked ~ ul { display: flex; } input:checked ~ label { .open { display: none; } .close { display: block; } } ul.navtabs { display: none; } } }