From ac3692ae43a4d237fcf831bbc6dab316de7890b4 Mon Sep 17 00:00:00 2001 From: object-Object Date: Tue, 5 Sep 2023 17:51:31 -0400 Subject: [PATCH] Add floating table of contents --- doc/src/hexdoc/_templates/main.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/src/hexdoc/_templates/main.css b/doc/src/hexdoc/_templates/main.css index 7874ed25..cb9ec4fe 100644 --- a/doc/src/hexdoc/_templates/main.css +++ b/doc/src/hexdoc/_templates/main.css @@ -105,6 +105,24 @@ canvas.spell-viz { margin: 4px 0; } +@media (min-width: 40rem) { + .book-body { + width: 70%; + left: 5%; + position: relative; + float: left; + } + + #table-of-contents { + position: sticky; + top: 0; + width: 25%; + float: left; + max-height: 80%; + overflow-y: scroll; + } +} + @media (prefers-color-scheme: dark) { body { background-color: #201a20;