From 9fe7c62d779b65bc36779e4f454da2ee2d6f1c44 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sat, 15 Feb 2020 11:49:19 +0100 Subject: [PATCH] Added scroll snap for better UX on search --- src/assets/stylesheets/layout/_search.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/assets/stylesheets/layout/_search.scss b/src/assets/stylesheets/layout/_search.scss index 0fd3a4f73..a9445583e 100644 --- a/src/assets/stylesheets/layout/_search.scss +++ b/src/assets/stylesheets/layout/_search.scss @@ -421,6 +421,7 @@ $md-toggle__search--checked: background-color: $md-color-white; box-shadow: 0 px2rem(1px) 0 $md-color-black--lightest inset; overflow-y: auto; + scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; // Mitigiate excessive repaints on non-retina devices @@ -478,6 +479,7 @@ $md-toggle__search--checked: color: $md-color-black--light; font-size: ms(-1); line-height: px2rem(36px); + scroll-snap-align: start; // [tablet landscape +]: Increase left indent @include break-from-device(tablet landscape) { @@ -510,6 +512,7 @@ $md-toggle__search--checked: transition: background 0.25s; outline: 0; overflow: hidden; + scroll-snap-align: start; // Focused or hovered link &:focus,