Skip to content

Instantly share code, notes, and snippets.

@geon
Created February 5, 2016 21:46
Show Gist options
  • Save geon/ad718ba330b47a1c0436 to your computer and use it in GitHub Desktop.
Save geon/ad718ba330b47a1c0436 to your computer and use it in GitHub Desktop.
Flexbox full-page web app layout with scrollable panels.
.full-screen.column
.header Header
.main.stretchy
.left Menu-stuff here
ul
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
li Menu Entry
.middle.stretchy Large stuff here
.right.column
.panel Details?
.panel Details?
.panel Details?
.panel Details?
.panel Details?
.panel.stretchy Details?
.footer Footer
.flex-container {
display: flex;
overflow: hidden;
&.column {
flex-direction: column;
}
&>* {
flex: 0 0 auto;
&.stretchy {
flex: 1 1 auto;
}
&>* {
overflow: auto;
}
}
}
html,
body,
.full-screen {
height: 100%;
margin: 0;
}
.full-screen {
.flex-container;
&>.header,
&>.footer {
height: 50px;
background: #555;
color: white;
}
&>.main {
.flex-container;
&>.left,
&>.right {
width: 200px;
background: #eee;
}
&>.right > .panel {
height: 100px;
margin: 10px;
background: white;
border-radius: 10px;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment