Skip to content

Commit bcb76c0

Browse files
nash-efpclaude
andcommitted
fix: prevent horizontal wobble on mobile scroll
- Replace overflow-x:hidden with overflow-x:clip on html/body/.obp-main/.VPPageContent (clip does not create a scroll container so position:fixed nav is unaffected) - Fix grid minmax to use min(300px,100%) so cards never overflow narrow viewports - Books row keeps overflow-x:auto for intentional horizontal scroll Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 33342a5 commit bcb76c0

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

.vitepress/theme/style.css

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@
3939
}/* ===== Reset / Base ===== */
4040
* { box-sizing: border-box; }
4141

42-
html {
43-
overflow-x: hidden;
44-
}
45-
46-
body {
47-
overflow-x: hidden;
42+
html, body {
43+
overflow-x: clip; /* clipはスクロールコンテナを生成しないため position:fixed に影響しない */
44+
max-width: 100%;
4845
background: var(--color-bg) !important;
4946
font-family: 'Inter', 'Noto Sans JP', system-ui, -apple-system, sans-serif !important;
5047
}
@@ -82,8 +79,8 @@ body {
8279

8380
.VPPageContent {
8481
padding: 0 !important;
85-
overflow-x: hidden;
86-
max-width: 100vw;
82+
overflow-x: clip;
83+
max-width: 100%;
8784
}
8885

8986
/* ===== Hero Section ===== */
@@ -393,6 +390,7 @@ body {
393390
max-width: 1120px;
394391
margin: 0 auto;
395392
padding: 0 2rem 6rem;
393+
overflow-x: clip; /* 書籍行のスクロールコンテナは内部で動作し続ける */
396394
}
397395

398396
/* ===== Section ===== */
@@ -503,7 +501,7 @@ body {
503501
/* ===== Card Grid ===== */
504502
.obp-grid {
505503
display: grid;
506-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
504+
grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
507505
gap: 16px;
508506
}
509507

0 commit comments

Comments
 (0)