mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Always set default primary and accent colors
This commit is contained in:
parent
ba90cb1ccd
commit
6fe1d55607
@ -81,8 +81,8 @@
|
|||||||
{% set palette = palette | first %}
|
{% set palette = palette | first %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set scheme = palette.scheme | d("default", true) %}
|
{% set scheme = palette.scheme | d("default", true) %}
|
||||||
{% set primary = palette.primary | d("", true) %}
|
{% set primary = palette.primary | d("indigo", true) %}
|
||||||
{% set accent = palette.accent | d("", 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(' ', '-') }}">
|
<body dir="{{ direction }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<body dir="{{ direction }}">
|
<body dir="{{ direction }}">
|
||||||
|
@ -37,7 +37,9 @@
|
|||||||
<form class="md-header__option" data-md-component="palette">
|
<form class="md-header__option" data-md-component="palette">
|
||||||
{% for option in config.theme.palette %}
|
{% for option in config.theme.palette %}
|
||||||
{% set scheme = option.scheme | d("default", true) %}
|
{% 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 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 %}
|
{% if option.toggle %}
|
||||||
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden>
|
<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" %}
|
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
|
||||||
|
@ -161,8 +161,8 @@
|
|||||||
{% set palette = palette | first %}
|
{% set palette = palette | first %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set scheme = palette.scheme | d("default", true) %}
|
{% set scheme = palette.scheme | d("default", true) %}
|
||||||
{% set primary = palette.primary | d("", true) %}
|
{% set primary = palette.primary | d("indigo", true) %}
|
||||||
{% set accent = palette.accent | d("", true) %}
|
{% set accent = palette.accent | d("indigo", true) %}
|
||||||
<body
|
<body
|
||||||
dir="{{ direction }}"
|
dir="{{ direction }}"
|
||||||
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
|
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
|
||||||
|
@ -76,12 +76,14 @@
|
|||||||
<form class="md-header__option" data-md-component="palette">
|
<form class="md-header__option" data-md-component="palette">
|
||||||
{% for option in config.theme.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
|
<input
|
||||||
class="md-option"
|
class="md-option"
|
||||||
data-md-color-media="{{ option.media }}"
|
data-md-color-media="{{ option.media }}"
|
||||||
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
|
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
|
||||||
data-md-color-primary="{{ option.primary | replace(' ', '-') }}"
|
data-md-color-primary="{{ primary | replace(' ', '-') }}"
|
||||||
data-md-color-accent="{{ option.accent | replace(' ', '-') }}"
|
data-md-color-accent="{{ accent | replace(' ', '-') }}"
|
||||||
{% if option.toggle %}
|
{% if option.toggle %}
|
||||||
aria-label="{{ option.toggle.name }}"
|
aria-label="{{ option.toggle.name }}"
|
||||||
{% else %}
|
{% else %}
|
||||||
|
Loading…
Reference in New Issue
Block a user