feat(theme): add Strawberry theme

Also, refactor themes and theme system to replace primary_light and
primary_dark with SCSS lighten/darken funcs.

See #1091
This commit is contained in:
George Cushen 2019-05-19 23:51:32 +01:00
commit 29ce18a050
14 changed files with 26 additions and 21 deletions

View file

@ -54,6 +54,8 @@ Choose a stunning color and font theme for your site. Themes are fully customiza
| --- | --- | --- | --- |
| ![apogee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-apogee.png) | ![1950s theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-1950s.png) | ![coffee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png) | ![cupcake theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-cupcake.png) |
[Browse more themes...](https://sourcethemes.com/academic/themes/)
## Ecosystem
* **[Academic Admin](https://github.com/sourcethemes/academic-admin):** An admin tool to import publications from BibTeX or import assets for an offline site

View file

@ -2,6 +2,9 @@
{{- $site := $scr.Get "site" -}}
{{- partial "functions/parse_theme" . -}}
$sta-darken-percentage: 10%;
$sta-lighten-percentage: 10%;
$sta-font-size: {{ $scr.Get "font_size" }};
$sta-font-size-small: {{ $scr.Get "font_size_small" }};
@ -11,8 +14,8 @@ $sta-font-nav: {{ $scr.Get "nav_font" }};
$sta-font-mono: {{ $scr.Get "mono_font" }};
$sta-primary: {{ $scr.Get "primary" }};
$sta-primary-light: {{ $scr.Get "primary_light" }};
$sta-primary-dark: {{ $scr.Get "primary_dark" }};
$sta-primary-light: lighten($sta-primary, $sta-lighten-percentage);
$sta-primary-dark: darken($sta-primary, $sta-darken-percentage);
$sta-link: {{ $scr.Get "link" }};
$sta-link-hover: {{ $scr.Get "link_hover" }};

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#EF525B"
primary_light = "#FF6771"
primary_dark = "#DA2536"
# Menu
menu_primary = "#24C2CB"

View file

@ -6,8 +6,6 @@ light = false
# Primary
primary = "#EAF04E"
primary_light = "#F8FD74"
primary_dark = "#D7DE26"
# Menu
menu_primary = "#312450"

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#795548"
primary_light = "#a98274"
primary_dark = "#4b2c20"
# Menu
menu_primary = "#795548"

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#EC407A"
primary_light = "#F793B5"
primary_dark = "#CD0045"
# Menu
menu_primary = "#BE37C7"

View file

@ -6,8 +6,6 @@ light = false
# Primary
primary = "hsl(339, 90%, 68%)"
primary_light = "hsl(339, 90%, 78%)"
primary_dark = "hsl(339, 90%, 58%)"
# Menu
menu_primary = "rgb(20, 22, 34)"

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#2962ff"
primary_light = "#768fff"
primary_dark = "#0039cb"
# Menu
menu_primary = "#fff"

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#4caf50"
primary_light = "#80e27e"
primary_dark = "#087f23"
# Menu
menu_primary = "#4caf50"

View file

@ -6,8 +6,6 @@ light = true
# Primary
primary = "#3f51b5"
primary_light = "#757de8"
primary_dark = "#002984"
# Menu
menu_primary = "#3f51b5" # 500

View file

@ -0,0 +1,18 @@
# Theme metadata
name = "Strawberry"
# Is theme light or dark?
light = true
# Primary
primary = "#ff3860"
# Menu
menu_primary = "#ff3860"
menu_text = "#fff"
menu_text_active = "rgb(208, 255, 56)"
menu_title = "#fff"
# Home sections
home_section_odd = "#fff"
home_section_even = "#fff"

View file

@ -2,7 +2,7 @@
# Documentation: https://sourcethemes.com/academic/
# Color theme.
# Choose from `default`, `ocean`, `forest`, `dark`, `apogee`, `1950s`, `coffee`, `cupcake`.
# Choose from `default`, `ocean`, `forest`, `dark`, `apogee`, `1950s`, `coffee`, `cupcake`, `strawberry`.
color_theme = "default"
# Enable users to switch between day and night mode?
day_night = true

BIN
images/theme-strawberry.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -42,8 +42,6 @@
{{- $scr.Set "link_hover" ($theme.link_hover | default $theme.primary) -}}
{{- $scr.Set "primary" $theme.primary -}}
{{- $scr.Set "primary_light" $theme.primary_light -}}
{{- $scr.Set "primary_dark" $theme.primary_dark -}}
{{- $scr.Set "menu_primary" $theme.menu_primary -}}
{{- $scr.Set "menu_text" $theme.menu_text -}}