Browse Source

themes: Support background option

George Cushen 7 years ago
parent
commit
5f8e04b83b

+ 2 - 1
data/themes/coffee.toml

@@ -15,6 +15,7 @@ menu_text = "rgba(255,255,255,0.6)"
 menu_text_active = "rgba(255,255,255,1)"
 menu_title = "#fff"
 
-# Home sections
+# Backgrounds
+background = "hsla(16, 24%, 85%, 1)"
 home_section_odd = "hsla(16, 24%, 85%, 1)"
 home_section_even = "hsla(16, 24%, 80%, 1)"

+ 1 - 1
layouts/partials/css/academic.css

@@ -37,6 +37,7 @@ body {
   font-size: 1rem;
   line-height: inherit;
   color: inherit;
+  background-color: {{ .Get "background" }};
   margin-top: 71px; /* Offset body content by navbar height. */
   padding-top: 0;
   counter-reset: captions;
@@ -1312,7 +1313,6 @@ div.alert a:hover {
  **************************************************/
 
 body.dark {
-  background-color: rgb(40, 42, 54);
   color: rgb(248, 248, 242);
 }
 

+ 8 - 0
layouts/partials/css/parse_theme.css

@@ -21,6 +21,14 @@
 
   {{- $scr.Set "light" $theme.light -}}
 
+  {{ if $theme.background }}
+    {{- $scr.Set "background" $theme.background -}}
+  {{ else if $theme.light }}
+    {{- $scr.Set "background" "#fff" -}}
+  {{ else }}
+    {{- $scr.Set "background" "rgb(40, 42, 54)" -}}
+  {{ end }}
+
   {{- $scr.Set "primary" $theme.primary -}}
   {{- $scr.Set "primary_light" $theme.primary_light -}}
   {{- $scr.Set "primary_dark" $theme.primary_dark -}}