Respect users's "reduced motion" preference for smooth scrolling

This commit is contained in:
Evan Hahn 2021-03-15 13:50:22 -05:00 committed by Josh Perez
parent 62e04a1bbd
commit 8ee653f252
3 changed files with 15 additions and 3 deletions

View File

@ -106,6 +106,16 @@
}
}
// Smooth scrolling
@mixin smooth-scroll() {
scroll-behavior: smooth;
@media (prefers-reduced-motion) {
scroll-behavior: auto;
}
}
// Icons
@mixin color-svg($svg, $color, $stretch: true) {

View File

@ -6308,12 +6308,13 @@ button.module-image__border-overlay:focus {
&__scroll-marker {
$scroll-marker-selector: &;
@include smooth-scroll;
display: flex;
justify-content: center;
left: 0;
opacity: 1;
position: absolute;
scroll-behavior: smooth;
transition: opacity 200ms ease-out;
width: 100%;
z-index: 1;
@ -6896,7 +6897,7 @@ button.module-image__border-overlay:focus {
// Module: conversation list
.module-conversation-list {
scroll-behavior: smooth;
@include smooth-scroll;
&__item {
&--archive-button {

View File

@ -2,6 +2,8 @@
// SPDX-License-Identifier: AGPL-3.0-only
.module-ContactPills {
@include smooth-scroll;
display: flex;
flex-wrap: wrap;
margin-bottom: 10px;
@ -9,7 +11,6 @@
overflow-x: hidden;
overflow-y: scroll;
padding-left: 12px;
scroll-behavior: smooth;
.module-ContactPill {
margin: 4px 6px;