diff --git a/stylesheets/_mixins.scss b/stylesheets/_mixins.scss index 5e1d3775a..1c90794c4 100644 --- a/stylesheets/_mixins.scss +++ b/stylesheets/_mixins.scss @@ -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) { diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 7c77536ea..96257fa62 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -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 { diff --git a/stylesheets/components/ContactPills.scss b/stylesheets/components/ContactPills.scss index c0ccc04b4..a8f827592 100644 --- a/stylesheets/components/ContactPills.scss +++ b/stylesheets/components/ContactPills.scss @@ -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;