From 5ae3be6d0f0ff394badbc30628318862a04c8ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Fri, 28 Apr 2023 00:05:40 +0200 Subject: [PATCH] Draw floating table-of-contents on the right when possible. --- static/style.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/static/style.css b/static/style.css index 6d87588..e1223e3 100644 --- a/static/style.css +++ b/static/style.css @@ -462,6 +462,21 @@ tr.__table-separator { border-bottom: 0.5ex solid black; } +/* Side-to-side */ +@media (min-width: 120ex) { + body { + margin: 0; + } + .global-table-of-contents { + position: fixed; + right: 1ex; + max-width: calc(100vw - 85ex); + top: 1ex; + overflow: auto; + max-height: 100vh; + } +} + /* Dark mode. */ @media (prefers-color-scheme: dark) { html {