I believe you are actually dealing with the flex
+ min-height
bug.
One way, to go over it, is to set the parent as a flex
column
element:
here
body {
display:flex;
flex-flow:column;
}
works fine. https://jsfiddle.net/10ohr6wy/3/
body {
display: flex;
flex-flow: column;
}
app {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.xui-page-body {
padding-bottom: 40px;
display: flex;
flex: 1;
flex-direction: column;
}
login-page {
flex: 1;
padding: 10px;
margin-bottom: -40px;
display: block;
background: green;
}
login {
display: block;
height: 200px;
background: red;
}
footer {
height: 50px;
display: block;
background: black;
}
<app>
<div class="xui-page-body">
<login-page>
<login></login>
</login-page>
</div>
<footer></footer>
</app>
if you do not set flex-direction
to column
, then app
needs to be the only child.
it can be sized via :
flex:1;
if you want to include margin
s
body {
display: flex;
}
app {
flex:1;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.xui-page-body {
padding-bottom: 40px;
display: flex;
flex: 1;
flex-direction: column;
}
login-page {
flex: 1;
padding: 10px;
margin-bottom: -40px;
display: block;
background: green;
}
login {
display: block;
height: 200px;
background: red;
}
footer {
height: 50px;
display: block;
background: black;
}
<app>
<div class="xui-page-body">
<login-page>
<login></login>
</login-page>
</div>
<footer></footer>
</app>
or
width:100%;
and box-sizing:border-box
to include border
and padding
if any.
body {
display: flex;
}
app {
width:100%;
box-sizing:border-box;
padding: 3em;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.xui-page-body {
padding-bottom: 40px;
display: flex;
flex: 1;
flex-direction: column;
}
login-page {
flex: 1;
padding: 10px;
margin-bottom: -40px;
display: block;
background: green;
}
login {
display: block;
height: 200px;
background: red;
}
footer {
height: 50px;
display: block;
background: black;
}
<app>
<div class="xui-page-body">
<login-page>
<login></login>
</login-page>
</div>
<footer></footer>
</app>