fix(recipes): make recipe modal viewport-safe (#891)

This commit is contained in:
Will Miao
2026-04-09 19:14:12 +08:00
parent db4726a961
commit 51fe7aa07e
2 changed files with 70 additions and 6 deletions

View File

@@ -5,7 +5,8 @@
top: var(--header-height, 48px); /* Start below the header */
left: 0;
width: 100%;
height: calc(100% - var(--header-height, 48px)); /* Adjust height to exclude header */
height: calc(100vh - var(--header-height, 48px)); /* Fallback for browsers without dvh */
height: calc(100dvh - var(--header-height, 48px)); /* Adjust height to exclude header */
background: rgba(0, 0, 0, 0.2); /* 调整为更淡的半透明黑色 */
z-index: var(--z-modal);
overflow: auto; /* Change from hidden to auto to allow scrolling */
@@ -23,7 +24,8 @@ body.modal-open {
position: relative;
max-width: 800px;
height: auto;
max-height: calc(100vh - var(--header-height, 48px) - 5.5rem); /* Subtract header height and modal margins */
max-height: calc(100vh - var(--header-height, 48px) - 5.5rem); /* Fallback for browsers without dvh */
max-height: calc(100dvh - var(--header-height, 48px) - 5.5rem); /* Subtract header height and modal margins */
margin: 1rem auto; /* Keep reduced top margin */
background: var(--lora-surface);
border-radius: var(--border-radius-base);