M _layouts/single.html => _layouts/single.html +1 -1
@@ 35,7 35,7 @@ layout: default
<section class="page__content" itemprop="text">
{% if page.toc %}
- <aside class="sidebar__right">
+ <aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label }}</h4></header>
{% include toc.html sanitize=true html=content h_min=2 h_max=3 class="toc__menu" %}
M => +13 -0
@@ 74,6 74,14 @@
margin-right: -1 * $right-sidebar-width-narrow;
padding-left: 1em;
z-index: 10;
&.sticky {
@include clearfix();
position: -webkit-sticky;
position: sticky;
top: 2em;
float: right;
}
}
@include breakpoint($x-large) {
@@ 279,6 287,7 @@
.wide .sidebar__right {
margin-bottom: 1em;
@include breakpoint($large) {
position: initial;
top: initial;
@@ 287,6 296,10 @@
margin-right: initial;
padding-left: initial;
z-index: initial;
&.sticky {
float: none;
}
}
@include breakpoint($x-large) {