Skip to content

Commit

Permalink
Flexbox sticky footer (mmistakes#2289)
Browse files Browse the repository at this point in the history
* Remove sticky footer JavaScript

* Use flexbox to force footer to the bottom of every page

* Fix flexbox in Internet Explorer
  • Loading branch information
mmistakes committed Oct 21, 2019
1 parent 5e56a59 commit 47bf58b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
5 changes: 0 additions & 5 deletions _sass/minimal-mistakes/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
margin-right: 0;
width: 100%;
clear: both;
/* sticky footer fix start */
position: absolute;
bottom: 0;
height: auto;
/* sticky footer fix end */
margin-top: 3em;
color: $muted-text-color;
-webkit-animation: $intro-transition;
Expand Down
16 changes: 16 additions & 0 deletions _sass/minimal-mistakes/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
}
}

body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
min-height: 100vh;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}

.initial-content,
.search-content {
flex: 1 0 auto;
}

.page {
@include breakpoint($large) {
float: right;
Expand Down
12 changes: 0 additions & 12 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
========================================================================== */

$(document).ready(function() {
// Sticky footer
var bumpIt = function() {
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
};

bumpIt();
$(window).resize(
jQuery.throttle(250, function() {
bumpIt();
})
);

// FitVids init
$("#main").fitVids();

Expand Down
5 changes: 1 addition & 4 deletions assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 47bf58b

Please # to comment.