Skip to content

Commit e352e4f

Browse files
authored
Merge pull request #1994 from Skwodo/master
fix overflow-x on mobile
2 parents 0e1384b + 734936d commit e352e4f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/theme/css/chrome.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ a > .hljs {
1212
color: var(--links);
1313
}
1414

15+
/*
16+
body-container is necessary because mobile browsers don't seem to like
17+
overflow-x on the body tag when there is a <meta name="viewport"> tag.
18+
*/
19+
#body-container {
20+
/*
21+
This is used when the sidebar pushes the body content off the side of
22+
the screen on small screens. Without it, dragging on mobile Safari
23+
will want to reposition the viewport in a weird way.
24+
*/
25+
overflow-x: hidden;
26+
}
27+
1528
/* Menu Bar */
1629

1730
#menu-bar,

src/theme/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
{{/if}}
5555
</head>
5656
<body>
57+
<div id="body-container">
5758
<!-- Provide site root to javascript -->
5859
<script>
5960
var path_to_root = "{{ path_to_root }}";
@@ -309,5 +310,6 @@
309310
{{/if}}
310311
{{/if}}
311312

313+
</div>
312314
</body>
313315
</html>

0 commit comments

Comments
 (0)