From fadf4edeb9be9328e4415133a88a1b780accec6a Mon Sep 17 00:00:00 2001 From: Giorgio Garofalo Date: Tue, 24 Sep 2024 23:16:22 +0200 Subject: [PATCH] Make ToC scrollable in slides if it overflows --- core/src/main/resources/render/theme/global.css | 14 ++++++++++++++ .../main/resources/render/theme/layout/minimal.css | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/core/src/main/resources/render/theme/global.css b/core/src/main/resources/render/theme/global.css index 3288fb50..1699085d 100644 --- a/core/src/main/resources/render/theme/global.css +++ b/core/src/main/resources/render/theme/global.css @@ -452,6 +452,20 @@ nav { text-align: start; } +/* ToC is scrollable in slides. */ +.reveal nav { + overflow-y: scroll; + max-height: 50vh; +} + +.reveal nav > ol { + /* + Content is clipped for some reason when overflow-y is enabled, + but this isn't needed if the list hides markers. + */ + margin-left: 24px; +} + h1#table-of-contents { text-align: start; } diff --git a/core/src/main/resources/render/theme/layout/minimal.css b/core/src/main/resources/render/theme/layout/minimal.css index f8905ca4..7d27c90f 100644 --- a/core/src/main/resources/render/theme/layout/minimal.css +++ b/core/src/main/resources/render/theme/layout/minimal.css @@ -134,6 +134,12 @@ nav li { margin: 4px 0; } +.reveal nav > ol { + /* Resets the no-clipping workaround because this theme's ToC hides list markers. */ + margin-left: auto; +} + + /* Footer */ .page-margin-bottom-center {