Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Last active December 16, 2016 00:27
Show Gist options
  • Select an option

  • Save joelstransky/4fd79bca8994ab2640b78f0ba124bf79 to your computer and use it in GitHub Desktop.

Select an option

Save joelstransky/4fd79bca8994ab2640b78f0ba124bf79 to your computer and use it in GitHub Desktop.
Sticky footer for WordPress
/**
* https://philipwalton.com/articles/normalizing-cross-browser-flexbox-bugs/
* 1. Avoid the IE 10-11 `min-height` bug.
* 2. Set `flex-shrink` to `0` to prevent Chrome, Opera, and Safari from
* letting these items shrink to smaller than their content's default
* minimum size.
*/
.Site {
display: flex;
flex-direction: column;
height: 100vh; /* 1 */
&.admin-bar {
height: calc(100vh - 32px);
@media screen and ( max-width: 782px ) {
height: calc(100vh - 46px);
}
}
}
.Site-header,
.Site-footer {
flex-shrink: 0; /* 2 */
}
.Site-content {
flex: 1 0 auto; /* 2 */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment