Skip to content

Commit

Permalink
Always set default primary and accent colors
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Apr 22, 2023
1 parent ba90cb1 commit 6fe1d55
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
{% set palette = palette | first %}
{% endif %}
{% set scheme = palette.scheme | d("default", true) %}
{% set primary = palette.primary | d("", true) %}
{% set accent = palette.accent | d("", true) %}
{% set primary = palette.primary | d("indigo", true) %}
{% set accent = palette.accent | d("indigo", true) %}
<body dir="{{ direction }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}">
{% else %}
<body dir="{{ direction }}">
Expand Down
6 changes: 4 additions & 2 deletions material/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
{% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ option.primary | replace(' ', '-') }}" data-md-color-accent="{{ option.accent | replace(' ', '-') }}" {% if option.toggle %} aria-label="{{ option.toggle.name }}" {% else %} aria-hidden="true" {% endif %} type="radio" name="__palette" id="__palette_{{ loop.index }}">
{% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %}
{% set accent = option.accent | d("indigo", true) %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}" {% if option.toggle %} aria-label="{{ option.toggle.name }}" {% else %} aria-hidden="true" {% endif %} type="radio" name="__palette" id="__palette_{{ loop.index }}">
{% if option.toggle %}
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden>
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
Expand Down
4 changes: 2 additions & 2 deletions src/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
{% set palette = palette | first %}
{% endif %}
{% set scheme = palette.scheme | d("default", true) %}
{% set primary = palette.primary | d("", true) %}
{% set accent = palette.accent | d("", true) %}
{% set primary = palette.primary | d("indigo", true) %}
{% set accent = palette.accent | d("indigo", true) %}
<body
dir="{{ direction }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
Expand Down
8 changes: 5 additions & 3 deletions src/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@
{% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %}
{% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %}
{% set accent = option.accent | d("indigo", true) %}
<input
class="md-option"
data-md-color-media="{{ option.media }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
data-md-color-primary="{{ option.primary | replace(' ', '-') }}"
data-md-color-accent="{{ option.accent | replace(' ', '-') }}"
data-md-color-primary="{{ primary | replace(' ', '-') }}"
data-md-color-accent="{{ accent | replace(' ', '-') }}"
{% if option.toggle %}
aria-label="{{ option.toggle.name }}"
{% else %}
Expand Down

0 comments on commit 6fe1d55

Please sign in to comment.