Skip to content

Commit

Permalink
docs: Prevent jarring 50% width for medium screens
Browse files Browse the repository at this point in the history
For screens that aren't terribly wide, there's a break point where the
current documentation design will snap to 50% width, and the text is
difficult to read due to the narrow layout. Rather than using 50% as the
rule, let's setup a couple good breakpoints that are wider than
Alabaster's default.

In particular, at the 875px breakpoint the sidebar appears, removing
220px from the content. So add a breakpoint at 875 + 220 px, allowing
the content width to grow up until that point, at which point we can cap
the width.

Fixes: 98cf8d5 ("docs: make page body wider")

Signed-off-by: Stephen Brennan <[email protected]>
  • Loading branch information
brenns10 authored and osandov committed Jan 12, 2024
1 parent 2ebdc10 commit 68fc466
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 11 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ div.admonition p.admonition-title {
font-size: 17px;
font-weight: bold;
}

@media screen and (min-width: 875px) {
div.document {
width: 100%;
}
}
@media screen and (min-width: 1095px) {
div.document {
width: 1095px;
}
}
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
"logo": "logo.png",
"logo_name": True,
"logo_text_align": "center",
# Make the page body wider.
"page_width": "50%",
"body_max_width": "auto",
"github_user": "osandov",
"github_repo": "drgn",
"github_button": True,
Expand Down

0 comments on commit 68fc466

Please sign in to comment.