Fix weird scroll behavior on back button

This commit is contained in:
prototypa
2023-01-08 12:33:13 -05:00
parent 8ce8421334
commit 8990e6adc3
2 changed files with 2 additions and 1 deletions

View File

@ -104,6 +104,7 @@ import { SITE } from '~/config.mjs';
};
window.onpageshow = function () {
document.documentElement.classList.add('motion-safe:scroll-smooth');
const elem = document.querySelector('[data-aw-toggle-menu]');
if (elem) {
elem.classList.remove('expanded');

View File

@ -16,7 +16,7 @@ const { language = 'en', textDirection = 'ltr' } = SITE;
---
<!DOCTYPE html>
<html lang={language} dir={textDirection} class="motion-safe:scroll-smooth 2xl:text-[20px]">
<html lang={language} dir={textDirection} class="2xl:text-[20px]">
<head>
<MetaTags {...meta} />
</head>