From 283fef2a628a245419a2ac35f8a3e0de92bea1fd Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Mon, 11 Jul 2016 22:08:49 -0400 Subject: [PATCH] fix jumping scrollbar --- web/scss/_global.scss | 8 ++++++++ web/scss/_header.scss | 15 ++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/web/scss/_global.scss b/web/scss/_global.scss index ccdc9d4a..fbc91467 100644 --- a/web/scss/_global.scss +++ b/web/scss/_global.scss @@ -139,4 +139,12 @@ $font-body: 'Raleway', sans-serif; width:1px; height:1px; overflow:hidden; +} + +@mixin jumpingScrollbarFix() { + // Fix for jumping scrollbar: https://aykevl.nl/2014/09/fix-jumping-scrollbar + @media screen and (min-width: 35em) { + margin-left: calc(100vw - 100%); + margin-right: 0; + } } \ No newline at end of file diff --git a/web/scss/_header.scss b/web/scss/_header.scss index c145e4d9..649f41bc 100644 --- a/web/scss/_header.scss +++ b/web/scss/_header.scss @@ -4,15 +4,16 @@ $color-nav-border: #ddd; .header { - width: 100%; - padding: 15px 0; - @include clearfix(); - position: relative; - z-index: 1; - .icon-close { display: none; } + padding: 15px 0; + @include clearfix(); + position: relative; + z-index: 1; + .icon-close { display: none; } + @include jumpingScrollbarFix(); } .header-absolute { + width: 100%; position: absolute; } .header-scroll @@ -122,7 +123,7 @@ $color-nav-border: #ddd; border-top: 1px $color-nav-border solid; border-bottom: 1px $color-nav-border solid; padding: $spacing-vertical / 2 0; - width: 100%; + @include jumpingScrollbarFix(); } .footer-img-link {