Skip to content

Instantly share code, notes, and snippets.

@belozerskiy
Created February 19, 2017 23:24
Show Gist options
  • Select an option

  • Save belozerskiy/def95ceff4545908dd3e88a7941a045d to your computer and use it in GitHub Desktop.

Select an option

Save belozerskiy/def95ceff4545908dd3e88a7941a045d to your computer and use it in GitHub Desktop.
Full height flexbox grid template
* {
margin: 0;
padding: 0;
}
*:before, *:after{
box-sizing: border-box;
}
body {
height: 100vh;
width: 100vw;
}
.grid {
display: flex;
flex-direction: row;
flex-grow: 1;
flex-wrap: wrap;
background: gray;
height: inherit;
width: inherit;
}
.grid-x {
display: flex;
flex-direction: column;
flex-grow: 1;
flex-wrap: wrap;
background: gray;
height: inherit;
width: inherit;
margin: 5px;
}
.grid-row {
display: flex;
flex-direction: row;
flex-grow: 1;
background: green;
margin: 5px;
}
.grid-left-column {
display: flex;
width: 50px;
height: inherit;
flex-direction: column;
background: black;
}
.grid-column {
display: flex;
flex-direction: row;
flex-grow: 1;
background: yellow;
margin: 5px;
}
<div class="grid">
<div class="grid-left-column">
</div>
<div class="grid-column">
<div class="grid-col">
<div class="grid-row">
<div class="grid-column"></div>
<div class="grid-column"></div>
<div class="grid-column"></div>
</div>
<div class="grid-row">
<div class="grid-column"></div>
<div class="grid-column"></div>
<div class="grid-column"></div>
</div>
</div>
</div>
</div>
@belozerskiy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment