Skip to content

Commit

Permalink
add basic back to top link to docs sidenavs, fixes twbs#12589
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Feb 5, 2014
1 parent 7861f6e commit f16a237
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_includes/nav-main.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<header class="navbar navbar-static-top bs-docs-nav" role="banner">
<header class="navbar navbar-static-top bs-docs-nav" role="banner" id="top">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
Expand Down
3 changes: 3 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ <h1>{{ page.title }}</h1>
{% include nav-migration.html %}
{% endif %}
</ul>
<a class="back-to-top" href="#top">
Back to top
</a>
</div>
</div>
</div>
Expand Down
25 changes: 23 additions & 2 deletions docs/assets/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ body {
padding-bottom: 10px;
}
.bs-sidebar .nav .nav > li > a {
padding-top: 2px;
padding-bottom: 2px;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 30px;
font-size: 12px;
font-weight: normal;
Expand All @@ -577,6 +577,27 @@ body {
padding-left: 28px;
}

/* Back to top (hidden on mobile) */
.back-to-top {
display: none;
margin-top: 10px;
margin-left: 10px;
padding: 4px 10px;
font-size: 12px;
font-weight: 500;
color: #999;
}
.back-to-top:hover {
text-decoration: none;
color: #563d7c;
}

@media (min-width: 768px) {
.back-to-top {
display: block;
}
}

/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-sidebar .nav > .active > ul {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/css/docs.min.css

Large diffs are not rendered by default.

0 comments on commit f16a237

Please sign in to comment.