Skip to content

Commit 32971cf

Browse files
committed
Restore mobile content gutter on docs pages
1 parent cb8f769 commit 32971cf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

docs/docs/assets/stylesheets/extra.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,19 @@ label.md-nav__title[for="__drawer"] {
207207
max-width: 125em;
208208
}
209209

210-
/* Keep prose line length stable when sidebars are hidden at narrower widths */
210+
/* Keep prose line length stable when sidebars are hidden at narrower
211+
widths. The auto margins replace Material's default `.8rem` side
212+
margins (which provide the mobile gutter), so add equivalent padding
213+
to restore the gutter — otherwise text touches the screen edges on
214+
phones, where the width resolves to 100% and the auto margins
215+
collapse to zero. `border-box` keeps the padding inside the capped
216+
width. */
211217
.md-main .md-content > .md-content__inner {
212218
width: min(100%, 47em);
213219
margin-left: auto !important;
214220
margin-right: auto !important;
221+
padding-left: 0.8rem;
222+
padding-right: 0.8rem;
215223
}
216224

217225
/* Notebook action buttons (Open in Colab, Download). The page title is the

0 commit comments

Comments
 (0)