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:
@@ -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 ── */
|
||||
|
||||
Reference in New Issue
Block a user