From b74c3f09634a94dd243749954db19fbd6da0a35a Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Mon, 7 Sep 2015 08:25:14 +0200 Subject: [PATCH] CSS: Fix sticky footer on IE10/11 --- layouts/css/layout/_sticky-footer.styl | 8 +++++--- layouts/partials/footer.hbs | 11 +++++++++++ static/js/modernizr.custom.js | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 static/js/modernizr.custom.js diff --git a/layouts/css/layout/_sticky-footer.styl b/layouts/css/layout/_sticky-footer.styl index 8ca114f2e4c2f..29d00fafdf7ac 100644 --- a/layouts/css/layout/_sticky-footer.styl +++ b/layouts/css/layout/_sticky-footer.styl @@ -1,10 +1,12 @@ -// html -// height 100% +// Modernizr test for IE10 and IE11 +// see: http://thatemil.com/blog/2013/11/03/sticky-footers-flexbox-and-ie10/ +.flexboxtweener +.flexboxtweener body + height 100% body display flex flex-direction column - // height 100% min-height 100vh margin 0 diff --git a/layouts/partials/footer.hbs b/layouts/partials/footer.hbs index a61c0c6c115e9..252933c1b5433 100644 --- a/layouts/partials/footer.hbs +++ b/layouts/partials/footer.hbs @@ -26,3 +26,14 @@ + +{{!-- Load Modernizr dynamically for IE10/11 and add test classes for sticky footer with flexbox --}} + diff --git a/static/js/modernizr.custom.js b/static/js/modernizr.custom.js new file mode 100644 index 0000000000000..bef9581298f65 --- /dev/null +++ b/static/js/modernizr.custom.js @@ -0,0 +1,4 @@ +/* Modernizr 2.8.3 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-cssclasses-addtest-testprop-testallprops-domprefixes + */ +;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e});for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,e._version=d,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.join(" "):""),e}(this,this.document);