From a44cdf07825c10e16434f86a6a01be88963306a9 Mon Sep 17 00:00:00 2001 From: f0x Date: Sun, 28 Jul 2024 22:54:31 +0200 Subject: [PATCH] about page table of contents sidebar --- web/assets/static-pages/about.html | 32 +++++++++++------------ web/source/css/base/main.css | 6 +++++ web/source/css/layout/page.css | 41 ++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/web/assets/static-pages/about.html b/web/assets/static-pages/about.html index d5c16aab4..e86c3fdd1 100644 --- a/web/assets/static-pages/about.html +++ b/web/assets/static-pages/about.html @@ -36,23 +36,23 @@ -
+
+
-

About GoToSocial Testrig Instance

diff --git a/web/source/css/base/main.css b/web/source/css/base/main.css index aa054e505..2f877bb57 100644 --- a/web/source/css/base/main.css +++ b/web/source/css/base/main.css @@ -27,6 +27,12 @@ html, body { scrollbar-color: $orange1 $gray3; } +@media (prefers-reduced-motion: no-preference) { + html { + scroll-behavior: smooth; + } +} + body { line-height: 1.5em; position: relative; diff --git a/web/source/css/layout/page.css b/web/source/css/layout/page.css index c751ba31b..b09bd985b 100644 --- a/web/source/css/layout/page.css +++ b/web/source/css/layout/page.css @@ -81,6 +81,47 @@ .page-content { grid-column: 2; align-self: start; + + &.with-sidebar { + grid-column: 1 / span 2; + display: grid; + grid-template-columns: 1fr minmax(auto, 50rem); + grid-template-columns: 1fr min(92%, 50rem); + + .sidebar { + align-self: start; + position: sticky; + top: 0; + padding: 0 1.5rem; + + h2 { + margin-top: 1.5rem; + } + } + } +} + +@media screen and (max-width: 80rem) { + .page-content.with-sidebar { + grid-column: 2; + display: flex; + flex-direction: column; + background: $bg-accent; + box-shadow: $boxshadow; + border: $boxshadow-border; + border-radius: $br; + + .sidebar { + position: static; + } + + main.single-page { + background: initial; + box-shadow: initial; + border: initial; + border-radius: initial; + } + } } .page-footer {