Skip to content

Commit

Permalink
feat: support to customize the brand color
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytse committed May 26, 2021
1 parent 02bba59 commit 8a5b85e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
11 changes: 11 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ yat:
# Custom color as below:
# theme_color: "#882250"

# You can choose a brand color
# Default brand colors as below:
# orangered: #ff5100
# greatgold: #f2cb05
# greenblue: #389092
#
# brand_color: orangered
#
# Custom color as below:
# brand_color: "#1a8e42"

# Night/Dark mode
# Default mode is "auto", "auto" is for auto nightshift
# (19:00 - 07:00), "manual" is for manual toggle, and
Expand Down
1 change: 0 additions & 1 deletion _sass/yat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ $spacing-unit: 30px !default;

$text-color: #454545 !default;
$background-color: #fff !default;
$brand-color: #ff5100 !default;

$grey-color: #828282 !default;
$grey-color-light: lighten($grey-color, 40%) !default;
Expand Down
21 changes: 18 additions & 3 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,33 @@

// Default theme colors
$theme-colors: (
coolblack: #090a0b,
spacegrey: #353535,
snowwhite: #ffffff,
"coolblack": #090a0b,
"spacegrey": #353535,
"snowwhite": #ffffff,
);

// Default brand colors
$brand-colors: (
"orangered": #ff5100,
"greatgold": #f2cb05,
"greenblue": #389092,
);

$theme-name: "{{ site.theme_color }}";
$brand-name: "{{ site.brand_color }}";
$theme-color: map-get($theme-colors, "snowwhite");
$brand-color: map-get($brand-colors, "orangered");

@if map-has-key($theme-colors, $theme-name) {
$theme-color: map-get($theme-colors, $theme-name);
} @else if str-index($theme-name, "#") == 1 {
$theme-color: {{ site.theme_color | default: '#ffffff' }};
}

@if map-has-key($brand-colors, $brand-name) {
$brand-color: map-get($brand-colors, $brand-name);
} @else if str-index($brand-name, "#") == 1 {
$brand-color: {{ site.brand_color | default: '#ff5100' }};
}

@import "yat";

0 comments on commit 8a5b85e

Please sign in to comment.