Flexbox items order in column - html

Live link here http://soloveich.com/pr6/blog/
Trying to put date with comments number and post preview in column on mobile screen. Also, bring the date with comments to first place when on mobile screen.
Weridly, it works perfectly on resolution emulators, but nothing happens on phones (iphones and old sgs.)
Html
<div class="postpreview">
<div class="psto"></div>
<div class="datencomments"></div>
</div>
Plus whatever insides
css
.postpreview {
display: flex;
display: -webkit-flex;
display: -moz-flex;
flex-direction:row;
-webkit-flex-direction:row;
-moz-direction:row;
}
.psto {
flex:5;
-webkit-flex:5;
-moz-flex:5;
}
.datencomments {
flex:2;
-webkit-flex:2;
-moz-flex:2;
vertical-align: top !important;
margin-top: 15px;
}
#media screen and (max-width: 380px) {
.postpreview {
display: flex;
display: -webkit-flex;
display: -moz-flex;
flex-direction:column;
-webkit-flex-direction:column;
-moz-direction:column;
}
}
Can't figure out if it's my css (why would it work in emulator then?) or problem with mobile browsers

The majority of mobile browsers only support the old 2009 Flexbox properties. Your code should look like this:
.postpreview {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.psto {
-webkit-box-flex: 5;
-moz-box-flex: 5;
-webkit-flex: 5;
-ms-flex: 5;
flex: 5;
}
.datencomments {
-webkit-box-flex: 2;
-moz-box-flex: 2;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
vertical-align: top !important;
margin-top: 15px;
}
#media screen and (max-width: 380px) {
.postpreview {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
}
Also note that the default flex-direction is row, so there's no need to specify it unless you're overwriting a previous flex-direction setting.

Related

How can a flex item be made to fit the height of its parent when using IE11?

In this example below I cannot find a way using the css flex model to make div B fill the height of div A. When flex-direction is column the child div still collapses even when no heights are specified.
.A {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background: #00b;
-ms-flex-direction: column;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
.B {
background: #b00;
-ms-flex: 1 1 0%;
-webkit-box-flex: 1;
flex: 1 1 0%;
}
<div class="A">
<div class="B">
I WISH I WAS AS BIG AS MY DAD
</div>
</div>
Revised answer based on a question edit.
This is one of IE's many flex bugs, where it won't recognize its parents height under some circumstances.
In this case, when using flex container with column direction, if you use a unitless value for flex-basis you'll get the same result cross browsers.
.A {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background: #00b;
-ms-flex-direction: column;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
.B {
background: #b00;
-ms-flex: 1 1 0;
-webkit-box-flex: 1;
flex: 1 1 0;
}
<div class="A">
<div class="B">
I WISH I WAS AS BIG AS MY DAD
</div>
</div>
If the sole purpose is to make the items fit the height of its parent, I recommend to use the longhand flex-grow: 1 instead.
Fiddle demo
Stack snippet
.A {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background: #00b;
-ms-flex-direction: column;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
.B {
background: #f66;
-ms-flex-grow: 1;
-webkit-box-flex: 1;
flex-grow: 1;
}
<div class="A">
<div class="B">
I AM AS BIG AS MY DAD
</div>
</div>
Here is also a fiddle sample, showing both a row and column version.

Flex-box not working in Safari

This is SO frustrating. I have tried dozens of "fixes" I am hoping someone can help. I have a flexbox that works well in Chrome and IE, but not Safari (iOS and desktop).
The CSS:
.resulist40 {
list-style: none;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
float:clear;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
height: 350px;
width: initial;
}
.reslist40 {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
min-height: 34px;
}
The HTML:
<ul class="resulist40">
<li class="reslist40">
<a onclick="dovid(1);">Day 1</a>
</li>
<li class="reslist40">
</li>...
</ul>
Here is the desired look (from CHROME):
Here is what it looks like in Safari:
This is my fix, I am not 100% happy. It seems that Safari dosen't work well without having a fixed width - so the flexbox is not really responsive. I found that a width of 130px gives me 3 cols on all browsers.
.resulist40 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
width: 100%;
padding-left: 10px;
}
.reslist40 {
list-style: none;
display: inline-block;
width: 130px;
height: 34px;
text-align: left;
}
Don't mind me as I dig up this post. I had a similar
misfortune recently but in my case I had...
img {
height: auto;
width: 100%;
}
and Safari was not having it. So I changed it to...
img {
height: 100%;
width: 100%;
}
which made Safari happy again.

Flexbox, flex-direction: column, image and IE11 bug. Can this be solved?

I have a containing <ul> that is display: flex horizontal. Each <li> is 25% width and also display: flex to get them all equal heights.
Each <li> contains an anchor that is display: flex column, to align the elements within correctly, including the main image container and image. In every browser, including IE10 this is absolutely fine, no issues. However, in IE11 this is where the problems start.
IE11 calculates the image container height as the actual height of the source image, and not the height of the image when rendered. This ends up rendering the <li> much, much taller than it should be.
How the layout looks in every self-respecting browser:
How the layout looks in IE11:
Check out the live example
I know this could be solved by explicitly defining the image height, but I don't want to do that. I could also solve it with JS, but again, I shouldn't have to. Am I missing something with this, as it doesn't appear to be listed on Flexbugs.
* {
box-sizing: border-box;
}
img {
display: block;
width: 100%;
}
.promotions-list {
background-color: #eaeaea;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: .5rem 1rem;
width: 960px;
}
.promotions-list__item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 1rem;
width: 25%;
}
.promotions-list__link {
background-color: white;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
overflow: hidden;
padding: 1em;
position: relative;
width: 100%;
}
.promotions-list .image-container {
display: block;
height: auto;
}
.promotions-list .image-container img {
display: block;
margin: 0 auto;
max-width: 40%;
}
<ul class="promotions-list">
<li class="promotions-list__item has-image">
<a href="/promotion/358/the-new-l5000-mono-laser-range-from-brother" class="promotions-list__link" title="Link to The NEW L5000 Mono Laser Range from Brother details">
<span class="promotions-list__item__header">
<span class="image-container">
<img src="//cdn.2020prosoftware.com/installations/1/promotions/358/original/NewModel2016.png">
</span>
<span class="list__item__title">The NEW L5000 Mono Laser Range from Brother</span>
</span>
<span class="promotions-list__item__body">
<span class="description">The NEW standard in reliability! Introducing new, improved printers from Brother, the market leader…</span>
</span>
</a>
</li>
</ul>
This appears to be fixed by setting flex: 0 0 auto on .promotions-list__item__header.
* {
box-sizing: border-box;
}
img {
display: block;
width: 100%;
}
.promotions-list {
background-color: #eaeaea;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: .5rem 1rem;
width: 960px;
}
.promotions-list__item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 1rem;
width: 25%;
}
.promotions-list__link {
background-color: white;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
overflow: hidden;
padding: 1em;
position: relative;
width: 100%;
}
.promotions-list .image-container {
display: block;
height: auto;
}
.promotions-list .image-container img {
display: block;
margin: 0 auto;
max-width: 40%;
}
/* Added */
.promotions-list__item__header {
flex: 0 0 auto;
}
<ul class="promotions-list">
<li class="promotions-list__item has-image">
<a href="/promotion/358/the-new-l5000-mono-laser-range-from-brother" class="promotions-list__link" title="Link to The NEW L5000 Mono Laser Range from Brother details">
<span class="promotions-list__item__header">
<span class="image-container">
<img src="//cdn.2020prosoftware.com/installations/1/promotions/358/original/NewModel2016.png">
</span>
<span class="list__item__title">The NEW L5000 Mono Laser Range from Brother</span>
</span>
<span class="promotions-list__item__body">
<span class="description">The NEW standard in reliability! Introducing new, improved printers from Brother, the market leader…</span>
</span>
</a>
</li>
</ul>

Flexbox two rows same width with overflow

I'm trying to create a "simple" information bar that should be displayed inline.
The bar consist of two divs, where the first contains all the required info (and is always visible) and the second shows information messages when they apply.
I have created a pen to demonstrate here.
My problem is that the content of the upper div is not always the same width and in some cases it overflows (which is a valid behavior based on my requirements since I always want it to be in one line). Thus when the screen gets shrinked enough the upper div overflows but the below keeps a width same as the screen width and does not follow the upper div's width.
What I want to achieve is make the below div have the same width as the upper even when the upper one overflows. Any ideas anyone?
Adding code here as well for reference:
HTML:
<h2> Shrink me to see than warning div is not the same width as the other one</h2>
<div id="TaskTimeBar">
<div id='main-wrapper'>
<div class="task-time-bar-content">
<div id="time-cell">
<div class='time-container'>
<i class="fa fa-clock-o"></i>21:12
</div>
</div>
<div id="active-task-bar-main-content">
<div><i class="fa fa-link"></i> #28125</div>
<div><i class="fa fa-info"></i> This can be a long text...</div>
<div><i class="fa fa-user"></i> Yo mama</div>
</div>
<div id="active-task-bar-buttons">
<div class="active-bar-button-wrapper">
<button>Stop</button>
</div>
<div class="active-bar-button-wrapper">
<button>Switch To #28192</button>
</div>
</div>
</div>
</div>
<div class="active-task-bar-information">This is an information message</div>
</div>
CSS:
#TaskTimeBar {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
#main-wrapper {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
.task-time-bar-content {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
padding: 5px;
}
#time-cell {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: bold;
font-size: 22px;
}
.time-container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
justify-content: center;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.time-container i {
padding-right: 5px;
}
#active-task-bar-main-content {
padding: 0 10px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-pack: space-around;
-ms-flex-pack: space-around;
-webkit-justify-content: space-around;
-moz-justify-content: space-around;
justify-content: space-around;
}
#active-task-bar-main-content div {
padding: 0 10px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
}
#active-task-bar-buttons {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
padding: 0 10px;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
-moz-justify-content: flex-end;
justify-content: flex-end;
}
.active-bar-button-wrapper {
line-height: 28px;
margin-right: 5px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.active-task-bar-information {
background-color: #ffa500;
color: #f3ebf8;
border: thin solid #808080;
border-top: none;
text-align: center;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
justify-content: center;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
Edit:
Let me explain a little bit more based on the div's ids as asked in the comments.
I hava a #TaskTimeBar that contains two divs inside, #main-wrapper and #active-task-bar-information. Requirements are as follows:
#main-wrapper should always be in one line
#active-task-bar-information should always have the same width as #main-wrapper and be underneath it.
The problem is that when the screen becomes small the contents of #main-wrapper overflow and exceed the screen width but #active-task-bar-information does not follow. If you play around with the window width in the linked pen you will see the effect.
Just to make sure I got this right:
main-wrapper never actually wraps it's content, therefore it overflows.
active-task-bar-information content actually wraps and never exceeds the viewport.
main-wrapper's behavior is correct.
active-task-bar-information's behavior is not correct. It should behave as it's sibling #main-wrapper.
Going by these criterions I think I got it. Try this:
html { box-sizing: border-box; font: 16px/1.5 Consolas; }
body { width: 100%; min-width: 60em; height: auto; }
*, *:before, *:after { box-sizing: inherit; margin: 0; padding: 0; border: 0; }
#TaskTimeBar {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -moz-inline-box;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-box-pack: stretch;
-ms-flex-pack: stretch;
-webkit-justify-content: stretch;
-moz-justify-content: stretch;
justify-content: stretch;
}
#main-wrapper {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
.task-time-bar-content {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
padding: 5px;
}
#time-cell {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: bold;
font-size: 22px;
}
.time-container {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -moz-inline-box;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
justify-content: center;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.time-container i {
padding-right: 5px;
}
#active-task-bar-main-content {
padding: 0 10px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-pack: space-around;
-ms-flex-pack: space-around;
-webkit-justify-content: space-around;
-moz-justify-content: space-around;
justify-content: space-around;
}
#active-task-bar-main-content div {
padding: 0 10px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
}
#active-task-bar-buttons {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
padding: 0 10px;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
-moz-justify-content: flex-end;
justify-content: flex-end;
}
.active-bar-button-wrapper {
line-height: 28px;
margin-right: 5px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.active-task-bar-information {
background-color: #ffa500;
color: #f3ebf8;
border: thin solid #808080;
border-top: none;
text-align: center;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
justify-content: center;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
To get more accurate results I reset everything to border-box sizing, zeroed all margins, paddings, and borders. That's optional.
I changed how the parent flexbox (TaskTimeBar) contents are kept since main-wrapper and active-task-bar-information are siblings. The changes are as follows:
#TaskTimeBar {...
.....
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-box-pack: stretch;
-ms-flex-pack: stretch;
-webkit-justify-content: stretch;
-moz-justify-content: stretch;
justify-content: stretch;
}
TaskTimeBar (the parent) stretches it's children (main-wrapper and active-task-bar-information), past the viewport due to the justify property stretch and the flex-wrap property nowrap. As a side note, active-task-bar-information was always 2px shorter than main-wrapper until I did that reset and now they measure the same width in any sized viewport (as far as I'm able to determine).
Hopefully I understood your question properly and gave you appropriate advice.
EDIT: While I was fulfilling a request for a [demo][1], I added inline-flex to all three divs. Details are provided with the demo. Below are screenshots illustrating the 2 divs equal widths.
In this fiddle I've taken #zer00ne's code, and tried to simplify the situation, by keeping only the outer div a flex-box, instead of managing a hierarchy of flex-boxes. I've kept the inner divs in line with display: inline and white-space: nowrap. Is seems to achieve the desired result.

CSS3 Flex and Bootstrap

Using this example, http://www.bootply.com/126437/, I am trying to make my Bootstrap layout columns equal height, as well as still be fully responsive.
I am trying to get my head around how the CSS is working in the example but still haven't cracked it. With my own SASS, the layout looks fine on a large screen, but until I add "auto" to my flex, the columns aren't responsive on a small screen.
Any help would be appreciate to get this working on all size screens!
HAML/Bootstrap:
%section.row.row-flex.row-flex-wrap
.col-xs-12.col-sm-12.col-md-8.col-lg-8.column-flex
.flex-col
= field('block_2')
.col-xs-12.col-sm-12.col-md-4.col-lg-4.column-flex.one-column
.row
.col-xs-12.col-sm-6.col-md-12.col-lg-12
.events-image-block
= field('block_3')
.col-xs-12.col-sm-6.col-md-12.col-lg-12
= field('block_4')
%section.row.row-flex.row-flex-wrap
.col-xs-12.col-sm-6.col-md-4.col-lg-4.column-flex.one-column
.flex-col
= field('block_5')
.col-xs-12.col-sm-6.col-md-4.col-lg-4.column-flex.one-column
.flex-col
= field('block_6')
.col-xs-12.col-sm-12.col-md-4.col-lg-4.column-flex.one-column
.flex-col
= field('block_7')
SASS:
section.row-flex {
display: -webkit-flex;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-box;
display: flex;
webkit-flex: 1;
-ms-flex: 1;
flex: 1;
&.row-flex-wrap {
-webkit-flex-flow: row wrap;
align-content: flex-start;
webkit-flex: 0;
-ms-flex: 0;
flex: 0;
}
& > .column-flex {
display: -webkit-flex;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-box;
display: flex;
margin: -.2px;
&.one-column {
webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
}
.flex-col,
.flex-col > div {
flex-flow: column nowrap;
display: -webkit-flex;
display: flex;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.flex-grow {
display: flex;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
}
}