Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 69af3d9

Browse files
committedJul 12, 2017
Add vertical scrollbar to sidebars that extend outside the viewport
Viewing overflowing sidebar content requires scrolling the entire page which is annoying and causes the reader to lose their place. Use CSS `calc` to approximate height of the sidebar (`100vh` - height of the masthead) and apply `overflow-y: auto` to add vertical scrollbars when needed. Fixes mmistakes#706
1 parent 606ee3e commit 69af3d9

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed
 

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Unreleased
2+
3+
### Enhancements
4+
5+
- Add scrollbar to sidebars with overflowing content that extends outside the viewport's height. [#706](https://github.com/mmistakes/minimal-mistakes/issues/706)
6+
17
## [4.4.2](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.4.2)
28

39
### Enhancements

‎_sass/minimal-mistakes/_sidebar.scss

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
&:hover {
2323
opacity: 1;
2424
}
25+
26+
&.sticky {
27+
overflow-y: auto;
28+
/* calculate height of nav list */
29+
height: calc(100vh - 90px - 2em); // viewport height - approx. masthead height - main content top margin
30+
}
2531
}
2632

2733
@include breakpoint($x-large) {

‎docs/_docs/18-history.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ permalink: /docs/history/
44
excerpt: "Change log of enhancements and bug fixes made to the theme."
55
sidebar:
66
nav: docs
7-
last_modified_at: 2017-07-07T15:45:45-04:00
7+
last_modified_at: 2017-07-12T11:57:08-04:00
88
---
99

10+
## Unreleased
11+
12+
### Enhancements
13+
14+
- Add scrollbar to sidebars with overflowing content that extends outside the viewport's height. [#706](https://github.com/mmistakes/minimal-mistakes/issues/706)
15+
1016
## [4.4.2](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.4.2)
1117

1218
### Enhancements

‎docs/_sass/minimal-mistakes/_sidebar.scss

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
&:hover {
2323
opacity: 1;
2424
}
25+
26+
&.sticky {
27+
overflow-y: auto;
28+
/* calculate height of nav list */
29+
height: calc(100vh - 90px - 2em); // viewport height - approx. masthead height - main content top margin
30+
}
2531
}
2632

2733
@include breakpoint($x-large) {

0 commit comments

Comments
 (0)
This repository has been archived.