From 80716c79a7db19d6d95070125e1af7946a9849ec Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 28 Dec 2021 21:18:02 +0100 Subject: Support for more complex layouts --- assets/css/_basics.scss | 2 +- assets/css/components/_header.scss | 9 ++--- templates/base.html | 14 +++---- templates/layouts/categorized_list.html | 68 +++++++++++++++++---------------- templates/layouts/gallery.html | 11 ++++++ templates/layouts/list.html | 28 +++++++------- templates/layouts/page.html | 2 +- templates/layouts/redirect.html | 2 +- 8 files changed, 74 insertions(+), 62 deletions(-) create mode 100644 templates/layouts/gallery.html diff --git a/assets/css/_basics.scss b/assets/css/_basics.scss index f2b2624..9619862 100644 --- a/assets/css/_basics.scss +++ b/assets/css/_basics.scss @@ -31,7 +31,7 @@ body { box-sizing: border-box; min-height: 100%; margin: 0; - padding: 2px; + padding: 0; } main { diff --git a/assets/css/components/_header.scss b/assets/css/components/_header.scss index 15fa5a1..56d09cd 100644 --- a/assets/css/components/_header.scss +++ b/assets/css/components/_header.scss @@ -15,6 +15,7 @@ --height: 4rem, --icon: 1.5rem, --pad-x: calc(.5 * (var(--header--dims--height) - var(--header--dims--icon))), + --gap: 2px, ) )); @@ -33,6 +34,8 @@ @include component(namespace()) { display: flex; height: prop(--dims --height); + padding: prop(--dims --gap); + gap: prop(--dims --gap); filter: drop-shadow(#{prop(--dims --obj-shadow, $global: true)} #{prop(--colors --obj-shadow, $global: true)}); @include element('item') { @@ -43,10 +46,6 @@ line-height: prop(--dims --height); text-decoration: none; - @include next-twin-element { - margin-left: 2px; - } - &:hover, &:focus { border-left-color: prop(--colors --hover --bg); @@ -73,7 +72,7 @@ @include media('>=lg') { position: sticky; - top: 2px; + top: 0; margin-bottom: calc(-.75 * #{prop(--dims --height)}); } diff --git a/templates/base.html b/templates/base.html index c1e1f4f..252069a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -63,17 +63,17 @@
-
- $if(layout.is_categorized_list)$ + $if(layout.is_categorized_list)$ ${layouts/categorized_list()} - $elseif(layout.is_list)$ + $elseif(layout.is_list)$ ${layouts/list()} - $elseif(layout.is_redirect)$ + $elseif(layout.is_redirect)$ ${layouts/redirect()} - $else$ + $elseif(layout.is_gallery)$ +${layouts/gallery()} + $else$ ${layouts/page()} - $endif$ -
+ $endif$