From 3b2a9fedeff03f82e12e094497321a57175f5ecd Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:00:20 +0100 Subject: [PATCH] Move footer to bottom of viewport --- internal/assets/static/main.css | 19 +++++++-- internal/assets/templates/page.html | 64 +++++++++++++++-------------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index e0c2445..3ef1eb6 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -311,6 +311,10 @@ html { scroll-behavior: smooth; } +html, body { + height: 100%; +} + a { text-decoration: none; color: inherit; @@ -424,6 +428,7 @@ kbd:active { .content-bounds { max-width: 1600px; + width: 100%; margin-inline: auto; padding: 0 var(--content-bounds-padding); } @@ -654,7 +659,7 @@ kbd:active { } .footer { - margin-block: calc(var(--widget-gap) * 1.5); + padding-block: calc(var(--widget-gap) * 1.5); animation: loadingContainerEntrance 200ms backwards; animation-delay: 150ms; } @@ -1227,8 +1232,14 @@ kbd:active { } } - body { - padding-bottom: calc(var(--mobile-navigation-height) + var(--content-bounds-padding)); + .mobile-navigation-offset { + height: var(--mobile-navigation-height); + margin-top: var(--widget-gap); + flex-shrink: 0; + } + + .footer + .mobile-navigation-offset { + margin-top: 0; } .mobile-navigation { @@ -1431,6 +1442,7 @@ kbd:active { .shrink-0 { flex-shrink: 0; } .min-width-0 { min-width: 0; } .max-width-100 { max-width: 100%; } +.height-100 { height: 100%; } .block { display: block; } .inline-block { display: inline-block; } .overflow-hidden { overflow: hidden; } @@ -1462,6 +1474,7 @@ kbd:active { .margin-top-7 { margin-top: 0.7rem; } .margin-top-10 { margin-top: 1rem; } .margin-top-15 { margin-top: 1.5rem; } +.margin-top-auto { margin-top: auto; } .margin-block-3 { margin-block: 0.3rem; } .margin-block-5 { margin-block: 0.5rem; } .margin-block-7 { margin-block: 0.7rem; } diff --git a/internal/assets/templates/page.html b/internal/assets/templates/page.html index c83923b..cfb0b5e 100644 --- a/internal/assets/templates/page.html +++ b/internal/assets/templates/page.html @@ -25,43 +25,47 @@ {{ end }} {{ define "document-body" }} -
-
- - -