Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for tall nav headers in the mkdocs theme #1969

Merged
merged 2 commits into from Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/about/release-notes.md
Expand Up @@ -91,6 +91,10 @@ do, adding `--strict`, `--theme`, `--theme-dir`, and `--site-dir`.
* Add canonical tag to `readthedocs` theme (#1669).
* Improved error message for when `git` is not available.
* Add support for `nav_style` theme option for the `mkdocs` theme (#1930).
* Bugfix: Long/nested dropdowns now behave more consistently for the `mkdocs`
theme (#1234).
* Bugfix: Multi-row nav headers in the `mkdocs` theme no longer obscure the
document content (#716).

## Version 1.0.4 (2018-09-07)

Expand Down
20 changes: 14 additions & 6 deletions mkdocs/themes/mkdocs/css/base.css
@@ -1,13 +1,11 @@
html {
/* csslint ignore:start */
scroll-padding-top: 70px;
/* The nav header is 3.5rem high, plus 20px for the margin-top of the
main container. */
scroll-padding-top: calc(3.5rem + 20px);
/* csslint ignore:end */
}

body {
padding-top: 70px;
}

/* Replacement for `body { background-attachment: fixed; }`, which has
performance issues when scrolling on large displays. See #1394. */
body::before {
Expand All @@ -24,9 +22,17 @@ body::before {
}

body > .container {
margin-top: 20px;
min-height: 400px;
}

.navbar.fixed-top { /* csslint allow: adjoining-classes */
/* csslint ignore:start */
position: -webkit-sticky;
position: sticky;
/* csslint ignore:end */
}

ul.nav .main {
font-weight: bold;
}
Expand Down Expand Up @@ -133,7 +139,9 @@ footer {
position: -webkit-sticky;
position: sticky;
/* csslint ignore:end */
top: 80px;
/* The nav header is 3.5rem high, plus 20px for the margin-top of the
main container. */
top: calc(3.5rem + 20px);
}

.bs-sidebar.card { /* csslint allow: adjoining-classes */
Expand Down