Skip to content

Commit

Permalink
themes: Support background option
Browse files Browse the repository at this point in the history
  • Loading branch information
gcushen committed Dec 3, 2017
1 parent 2b77316 commit 5f8e04b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data/themes/coffee.toml
Expand Up @@ -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)"
2 changes: 1 addition & 1 deletion layouts/partials/css/academic.css
Expand Up @@ -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;
Expand Down Expand Up @@ -1312,7 +1313,6 @@ div.alert a:hover {
**************************************************/

body.dark {
background-color: rgb(40, 42, 54);
color: rgb(248, 248, 242);
}

Expand Down
8 changes: 8 additions & 0 deletions layouts/partials/css/parse_theme.css
Expand Up @@ -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 -}}
Expand Down

0 comments on commit 5f8e04b

Please sign in to comment.