1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 01:10:58 +01:00

Formatting

This commit is contained in:
squidfunk 2021-04-11 14:17:47 +02:00
parent 8015c3991e
commit b968bf6e8f
3 changed files with 5 additions and 7 deletions

View File

@ -27,10 +27,9 @@
</div> </div>
</div> </div>
</div> </div>
{% set palette = config.theme.palette %} {% if not config.theme.palette is mapping %}
{% if palette and not palette is mapping %}
<form class="md-header__option" data-md-component="palette"> <form class="md-header__option" data-md-component="palette">
{% for option in palette %} {% for option in config.theme.palette %}
{% set primary = option.primary | replace(" ", "-") | lower %} {% set primary = option.primary | replace(" ", "-") | lower %}
{% set accent = option.accent | replace(" ", "-") | lower %} {% set accent = option.accent | replace(" ", "-") | lower %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ option.scheme }}" data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}" type="radio" name="__palette" id="__palette_{{ loop.index }}"> <input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ option.scheme }}" data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}" type="radio" name="__palette" id="__palette_{{ loop.index }}">

View File

@ -152,7 +152,7 @@
{% block extrahead %}{% endblock %} {% block extrahead %}{% endblock %}
</head> </head>
<!-- Text direction and color palette, if defined --> <!-- Set text direction and color palette, if defined -->
{% set direction = config.theme.direction or lang.t('direction') %} {% set direction = config.theme.direction or lang.t('direction') %}
{% if config.theme.palette %} {% if config.theme.palette %}
{% set palette = config.theme.palette %} {% set palette = config.theme.palette %}

View File

@ -64,10 +64,9 @@
</div> </div>
<!-- Color palette --> <!-- Color palette -->
{% set palette = config.theme.palette %} {% if not config.theme.palette is mapping %}
{% if palette and not palette is mapping %}
<form class="md-header__option" data-md-component="palette"> <form class="md-header__option" data-md-component="palette">
{% for option in palette %} {% for option in config.theme.palette %}
{% set primary = option.primary | replace(" ", "-") | lower %} {% set primary = option.primary | replace(" ", "-") | lower %}
{% set accent = option.accent | replace(" ", "-") | lower %} {% set accent = option.accent | replace(" ", "-") | lower %}
<input <input