Skip to content

Commit 4517de8

Browse files
author
Joseph Lowinske
committed
enforce max-width on content column; implement sticky on #toc-right
1 parent e6407bd commit 4517de8

File tree

6 files changed

+35
-10
lines changed

6 files changed

+35
-10
lines changed

_layouts/default.html

+3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
{% endif %}
2020
{{content}}
2121
</div>
22+
{% if page.no_toc == true %}
23+
{% else %}
2224
<div class="toc-col">
2325
<div id="toc-right"></div>
2426
</div>
27+
{% endif %}
2528
</div>
2629
</div>
2730
{% include footer.html %}

css/components/_toc.scss

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55

66
@include at-query($min, 1072px) {
77
padding: 30px 30px 30px 0;
8-
min-width: 360px;
8+
min-width: 275px;
9+
max-width: 275px;
910
display: inline-block;
1011
}
1112
}
1213

1314
#toc {
1415
display: block;
1516
max-width: 500px;
17+
margin: 0;
1618

1719
@include at-query($min, 1072px) {
1820
display: none;
@@ -21,15 +23,15 @@
2123

2224
#toc-right {
2325
max-width: 100%;
26+
margin: 30px 0 0 0;
2427
}
2528

2629
#toc,
2730
#toc-right {
2831

2932
> ul {
3033
background-color: $cl_green_light;
31-
padding: 20px 30px;
32-
margin: 0;
34+
padding: 20px;
3335
width: 100%;
3436

3537
li {

css/customstyles.css

+9-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/customstyles.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/layouts/_content.scss

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
padding-top: 50px;
2020
padding-bottom: 100px;
2121
max-width: 100%;
22+
min-width: 0;
2223

2324
@include at-query($min, $screen-md) {
2425
min-height: 625px;

js/customscripts.js

+16
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@ $(function() {
138138
$sidebar.animate({height: sideNavHeight}, {duration: 250});
139139
}
140140
}
141+
142+
if (_viewport_width >= 1072 && scrollTop >= 51) {
143+
$('#toc-right').css({
144+
position: 'fixed',
145+
top: 51,
146+
right: 30,
147+
width: '245px'
148+
});
149+
} else {
150+
$('#toc-right').css({
151+
position: 'relative',
152+
top: '',
153+
right: '',
154+
width: ''
155+
});
156+
}
141157
});
142158

143159
// Fire scroll event on load

0 commit comments

Comments
 (0)