I can't seem to wrap my head around this. I'm working on an (existing) menu structure. The current menu never intended the amount of sub-items we have, and as such it overflows from the viewport. Since its sticky some items aren't accessible which is problematic. Since flexbox has an issue where the flexbox itself doesn't adjust its width when wrapping columns, the background of the sub-menu doesn't continue. Again problematic since floating text, over other text, is annoying. Having read up on it, it appears the writing-mode solution is mostly used. However when I try to apply it, it still gets a singular row since the header element has to have position: fixed attached to it.
example to clarify:
html:
<header>
<div class="wrapper">
<ul class="parent">
<li class="child">Menu item 1</li>
<li class="child">Menu item 2</li>
<li class="child">Menu item 3
<ul class="sub-parent">
<li class="sub-child">Sub item 1</li>
<li class="sub-child">Sub item 2</li>
<li class="sub-child">Sub item 3</li>
<li class="sub-child">Sub item 4</li>
<li class="sub-child">Sub item 5</li>
<li class="sub-child">Sub item 6</li>
<li class="sub-child">Sub item 7</li>
<li class="sub-child">Sub item 8</li>
<li class="sub-child">Sub item 9</li>
<li class="sub-child">Sub item 10</li>
<li class="sub-child">Sub item 12</li>
<li class="sub-child">Sub item 13</li>
<li class="sub-child">Sub item 14</li>
<li class="sub-child">Sub item 15</li>
<li class="sub-child">Sub item 16</li>
<li class="sub-child">Sub item 17</li>
<li class="sub-child">Sub item 18</li>
<li class="sub-child">Sub item 19</li>
</ul>
</li>
<li class="child">Menu item 4</li>
<li class="child">Menu item 5</li>
<li class="child">Menu item 6</li>
</ul>
</div>
</header>
<div class="content">
Sub-items should wrap till end of viewport
</div>
css:
header{
position: fixed;
top: 0;
}
.wrapper{
background: #8AB9B5;
}
.parent{
display: flex;
background: #C8C2AE;
list-style: none;
width: 100vw;
}
.child{
margin: 0.5em;
}
.sub-parent{
display: flex;
flex-direction: row;
flex-wrap: wrap;
max-height: 80vh;
background: #D0CDD7;
position: absolute;
margin: 0;
list-style: none;
padding: 0;
writing-mode: vertical-lr;
}
.sub-child{
background: #ACB0BD;
display: block;
margin: 0.5em;
writing-mode: horizontal-tb;
}
.content{
margin-top:100px;
}
https://jsfiddle.net/Tristanschaaf/7pd504hj/99/
It's possible that the sub-items also have a sub-item structure.
I can't seem to find a way to make the flexbox to see it can expand vertically. Additionally there is an issue in Firefox on which the height seems to be initially set to 0 until a viewport resize is triggered.
I am very aware that this structure can cause it's own UX issues but I'm not here to discuss those, as per usual, the impact of that impacts other sides of the business as well and I cannot change it for now.

