parse_theme.css 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {{- $scr := .Scratch -}}
  2. {{- $site := $scr.Get "site" -}}
  3. {{/* Attempt to load font style specified by user. */}}
  4. {{- $font_index := .Site.Params.font | default "default" -}}
  5. {{ if isset .Site.Data.fonts $font_index }}
  6. {{- $font := index .Site.Data.fonts $font_index -}}
  7. {{- $scr.Set "google_fonts" $font.google_fonts -}}
  8. {{- $scr.Set "body_font" $font.body_font -}}
  9. {{- $scr.Set "heading_font" $font.heading_font -}}
  10. {{- $scr.Set "nav_font" $font.nav_font -}}
  11. {{- $scr.Set "mono_font" $font.mono_font -}}
  12. {{- $scr.Set "font_size" $font.font_size -}}
  13. {{- $scr.Set "font_size_small" $font.font_size_small -}}
  14. {{ end }}
  15. {{/* Attempt to load color theme specified by user. */}}
  16. {{- $theme_index := .Site.Params.color_theme | default "default" -}}
  17. {{ if isset .Site.Data.themes $theme_index }}
  18. {{ $theme := index .Site.Data.themes $theme_index }}
  19. {{- $scr.Set "light" $theme.light -}}
  20. {{- $scr.Set "primary" $theme.primary -}}
  21. {{- $scr.Set "primary_light" $theme.primary_light -}}
  22. {{- $scr.Set "primary_dark" $theme.primary_dark -}}
  23. {{- $scr.Set "menu_primary" $theme.menu_primary -}}
  24. {{- $scr.Set "menu_text" $theme.menu_text -}}
  25. {{- $scr.Set "menu_text_active" $theme.menu_text_active -}}
  26. {{- $scr.Set "menu_title" $theme.menu_title -}}
  27. {{- $scr.Set "home_section_odd" $theme.home_section_odd -}}
  28. {{- $scr.Set "home_section_even" $theme.home_section_even -}}
  29. {{ end }}