Skip to content

Commit

Permalink
docs: fix layout without JS enabled
Browse files Browse the repository at this point in the history
The Bootstrap stylesheet for the website sets the header to position:
fixed, taking it out of the layout flow. Some javascript later updates
the style attribute, so that the content is pushed down by an
appropriate amount.

If JS is disabled that correction doesn't happen, and so the header
overlaps the content.

Make the header static by default, and only apply position: fixed if
JavaScript is enabled.

Fixes #599

Signed-off-by: Peter Schultz <[email protected]>
  • Loading branch information
pschultz committed Mar 1, 2019
1 parent dd9ef7d commit 35103f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
height: 100%;
}

/* set navbar to static for now. If JS is enabled, we will revert to fixed in
* custom.js, but if JS isn't enabled a fixed header overlaps the content. */
.site-header.sticky .navbar {
position: static;
}

article.main-content {
padding-top: 0;
}
Expand Down
2 changes: 2 additions & 0 deletions docs/static/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$(function() {
// Make the navbar only fixed if JS is enabled, else it overlaps the content.
$(".site-header.sticky .navbar").css('position', 'fixed');
});

0 comments on commit 35103f8

Please sign in to comment.