Fix modal-open layout shift caused by position:fixed scroll lock

Replace the body position:fixed hack with overflow:hidden on html element,
which works cleanly with scrollbar-gutter:stable to prevent layout shift.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 22:37:10 +03:00
parent 997ff2fd70
commit 43fbc1eff5
3 changed files with 6 additions and 13 deletions

View File

@@ -91,10 +91,8 @@ body {
line-height: 1.6;
}
body.modal-open {
position: fixed;
width: 100%;
overflow-y: scroll; /* keep scrollbar gutter to prevent layout shift */
html.modal-open {
overflow: hidden; /* scrollbar-gutter: stable keeps the gutter reserved */
}
/* ── Ambient animated background ── */