Skip to content

Commit 0e490dc

Browse files
authoredOct 21, 2019
Flexbox sticky footer (mmistakes#2289)
* Remove sticky footer JavaScript * Use flexbox to force footer to the bottom of every page * Fix flexbox in Internet Explorer
1 parent 9f7ec2e commit 0e490dc

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed
 

‎_sass/minimal-mistakes/_footer.scss

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
margin-right: 0;
1010
width: 100%;
1111
clear: both;
12-
/* sticky footer fix start */
13-
position: absolute;
14-
bottom: 0;
15-
height: auto;
16-
/* sticky footer fix end */
1712
margin-top: 3em;
1813
color: $muted-text-color;
1914
-webkit-animation: $intro-transition;

‎_sass/minimal-mistakes/_page.scss

+16
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
}
2020
}
2121

22+
body {
23+
display: -webkit-box;
24+
display: -ms-flexbox;
25+
display: flex;
26+
min-height: 100vh;
27+
-webkit-box-orient: vertical;
28+
-webkit-box-direction: normal;
29+
-ms-flex-direction: column;
30+
flex-direction: column;
31+
}
32+
33+
.initial-content,
34+
.search-content {
35+
flex: 1 0 auto;
36+
}
37+
2238
.page {
2339
@include breakpoint($large) {
2440
float: right;

‎assets/js/_main.js

-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@
33
========================================================================== */
44

55
$(document).ready(function() {
6-
// Sticky footer
7-
var bumpIt = function() {
8-
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
9-
};
10-
11-
bumpIt();
12-
$(window).resize(
13-
jQuery.throttle(250, function() {
14-
bumpIt();
15-
})
16-
);
17-
186
// FitVids init
197
$("#main").fitVids();
208

‎assets/js/main.min.js

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.