aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/theme.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web/theme.go')
-rw-r--r--internal/web/theme.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/web/theme.go b/internal/web/theme.go
index 031f8fd..a43603b 100644
--- a/internal/web/theme.go
+++ b/internal/web/theme.go
@@ -54,6 +54,10 @@ type Theme struct {
NavSize string `json:"nav_size"` // normal | small | large
NavGap string `json:"nav_gap"` // normal | tight | wide (space around each link)
NavActive string `json:"nav_active"` // underline | bold | box | none: how the current page's link is marked
+ // NavFold folds the header menu into a button when its links do not fit
+ // the bar (see Layout.BurgerAt); NavFoldLabel is what the button shows.
+ NavFold bool `json:"nav_fold"`
+ NavFoldLabel string `json:"nav_fold_label"` // icon | text | both
NavBg string `json:"nav_bg"`
NavText string `json:"nav_text"`
NavHover string `json:"nav_hover"` // "" = same as NavText
@@ -118,7 +122,7 @@ func DefaultTheme() Theme {
ContentStyle: "card", ContentPadding: "normal",
Font: "sans", HeadingFont: "same", FontSize: "normal",
HeaderImageHeight: "medium", HeaderAlign: "left", HeaderBg: "#2f3a4a", HeaderText: "#ffffff", TitleSize: "normal", HeaderRule: "none",
- NavAlign: "left", NavBold: true, NavUnderline: "hover", NavSize: "normal", NavGap: "normal", NavActive: "underline", NavBg: "#ffffff", NavText: "#222222",
+ NavAlign: "left", NavBold: true, NavUnderline: "hover", NavSize: "normal", NavGap: "normal", NavActive: "underline", NavFoldLabel: "icon", NavBg: "#ffffff", NavText: "#222222",
ShowDates: true, DateFormat: "long", PostsPerPage: postsPerPageChoices[0], ListStyle: "full", PostImage: "top", TitleRule: "none", PostNotices: true,
FooterBg: "#2f3a4a", FooterColor: "#d0d5dc", FooterAlign: "center",
LogoSize: "medium",
@@ -213,6 +217,7 @@ func (t *Theme) normalize() {
t.NavSize = pick(t.NavSize, "normal", "small", "large")
t.NavGap = pick(t.NavGap, "normal", "tight", "wide")
t.NavActive = pick(t.NavActive, "underline", "bold", "box", "none")
+ t.NavFoldLabel = pick(t.NavFoldLabel, "icon", "text", "both")
t.NavBg = color(t.NavBg, d.NavBg)
t.NavText = color(t.NavText, d.NavText)
t.NavHover = optColor(t.NavHover)
@@ -287,6 +292,8 @@ func ThemeFromForm(cur Theme, f url.Values) Theme {
t.NavSize = get("nav_size")
t.NavGap = get("nav_gap")
t.NavActive = get("nav_active")
+ t.NavFold = on("nav_fold")
+ t.NavFoldLabel = get("nav_fold_label")
t.NavBg = get("nav_bg")
t.NavText = get("nav_text")
t.NavHover = hover("nav_hover")
@@ -591,7 +598,7 @@ a:hover {{"{"}}{{if .LinkHover}} color:{{.LinkHover}};{{end}}{{if eq .LinkUnderl
.site-header a { color:{{.HeaderText}}; }
.header-image img { max-height:{{.HeaderImageMaxHeight}}; }
.site-nav { background:{{.NavBg}}; }
-.site-nav a { color:{{.NavText}}; }
+.site-nav a, .site-nav .nav-burger { color:{{.NavText}}; }
{{- if .NavHover}}
.site-nav a:hover { color:{{.NavHover}}; }
{{- end}}