I'm building a website for myself with a two-column content layout, where the columns have a 1:2 aspect ratio, and I am trying to avoid using Grid for something that I believe Flexbox can more than easily handle. However, all of my attempts to force a wrap from the narrow left column to the wide right column using flex-basis: 100%;
do not work without an explicit, non percentage height set for the parent element. I don't know what to do. I've already used this article and referenced multiple questions for solutions, and literally nothing has worked.
I'm using Firefox 72 and this is supposed to work in recent versions of Firefox.
:root {
--bodywidth: 80vw;
--flexbasis: calc(var(--bodywidth) / 8);
--spacebasis: calc(var(--flexbasis) / 12);
--columnwidth: calc(var(--bodywidth) / 3);
}
/* https://tobiasahlin.com/blog/flexbox-break-to-new-row/ */
hr.break {
border: none;
margin: 0;
padding: 0;
flex-basis: 100%;
flex-grow: 1;
}
hr.row.break {
height: 0;
}
hr.col.break {
width: 0;
}
main {
display: flex;
flex-flow: column wrap;
/* height: 100%; /* << DOES NOT WORK */
/* height: 100vw; /* << Works perfectly fine, but NOT ideal */
}
/* vv As a bonus, these rules somehow make everything 2 column widths wide when only the stuff AFTER the break should be that wide */
main :not(.break) {
min-width: var(--columnwidth);
width: 100%;
}
main hr.break+* {
width: calc(var(--columnwidth) * 2);
}
<main>
<section>
<h1>About</h1>
<p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p>
</section>
<section>
<h1>Disclaimer</h1>
<p>Here there be naughty things!!!</p>
</section>
<!-- The amount of content on both sides of the break varies, as do the dimensions of the sections -->
<hr class="col break" />
<article class="blog">
<h1>Blog Entry</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend molestie orci. Donec pellentesque viverra magna, nec viverra velit laoreet non. Etiam blandit erat nulla, semper faucibus eros rhoncus vel.</p>
</article>
</main>
If I have to, I can hold my nose and use Grid and make it work, but it's not ideal by any stretch of the imagination and would require a whole lot of extra CSS to make it work. I would much rather use Flexbox if anyone has solutions.