From cf0dd07c213118857276540482223e3d490428aa Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sat, 31 Aug 2024 17:35:38 +0100 Subject: [PATCH] Add center-vertically property --- internal/assets/static/main.css | 6 ++++++ internal/assets/templates/page.html | 2 +- internal/glance/glance.go | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 37db60c..a8da75c 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -451,6 +451,12 @@ kbd:active { max-width: 1100px; } +.page-center-vertically .page { + display: flex; + justify-content: center; + flex-direction: column; +} + .dynamic-columns { gap: calc(var(--widget-content-vertical-padding) / 2); display: grid; diff --git a/internal/assets/templates/page.html b/internal/assets/templates/page.html index 4d08e61..d2cee76 100644 --- a/internal/assets/templates/page.html +++ b/internal/assets/templates/page.html @@ -11,7 +11,7 @@ {{ end }} -{{ define "document-root-attrs" }}class="{{ if .App.Config.Theme.Light }}light-scheme {{ end }}{{ if ne "" .Page.Width }}page-width-{{ .Page.Width }}{{ end }}"{{ end }} +{{ define "document-root-attrs" }}class="{{ if .App.Config.Theme.Light }}light-scheme {{ end }}{{ if ne "" .Page.Width }}page-width-{{ .Page.Width }} {{ end }}{{ if .Page.CenterVertically }}page-center-vertically{{ end }}"{{ end }} {{ define "document-head-after" }} {{ template "page-style-overrides.gotmpl" . }} diff --git a/internal/glance/glance.go b/internal/glance/glance.go index a8485f2..d26745f 100644 --- a/internal/glance/glance.go +++ b/internal/glance/glance.go @@ -73,6 +73,7 @@ type Page struct { Width string `yaml:"width"` ShowMobileHeader bool `yaml:"show-mobile-header"` HideDesktopNavigation bool `yaml:"hide-desktop-navigation"` + CenterVertically bool `yaml:"center-vertically"` Columns []Column `yaml:"columns"` mu sync.Mutex }