Remove smooth scroll effect from blog index/category pages, remove globally if user prefers reduced motion
This commit is contained in:
parent
80e2c41f04
commit
7dfcb64930
|
@ -1,5 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
|
||||
{% if page.url contains "/category" or page.url contains "/page" or page.url == "/blog/" %}
|
||||
{% assign class = 'no-smooth-scroll' %}
|
||||
{% endif %}
|
||||
<html class="{{ class }}" lang="{{ page.lang | default: site.lang | default: "en" }}">
|
||||
{%- include head.html -%}
|
||||
<body>
|
||||
{%- include header.html -%}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
html {
|
||||
scroll-behavior: smooth; // smooth anchor link scrolling
|
||||
// Smooth anchor scrolling unless .no-smooth-scroll is present
|
||||
html:not(.no-smooth-scroll) {
|
||||
scroll-behavior: smooth;
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
scroll-behavior: auto; // turn off if user prefers reduced motion
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
|
|
Loading…
Reference in New Issue