Formatting

This commit is contained in:
squidfunk 2022-11-12 15:08:01 +01:00
parent 9c8ee7cf94
commit a64ecac610
4 changed files with 10 additions and 18 deletions

View File

@ -81,10 +81,8 @@
{% if not palette is mapping %}
{% set palette = palette | first %}
{% endif %}
{% set scheme = palette.scheme | d("default", true) %}
{% set primary = palette.primary %}
{% set accent = palette.accent %}
<body dir="{{ direction }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}">
{% set scheme = palette.scheme | d("default", true) %}
<body dir="{{ direction }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ palette.primary | replace(' ', '-') }}" data-md-color-accent="{{ palette.accent | replace(' ', '-') }}">
{% else %}
<body dir="{{ direction }}">
{% endif %}

View File

@ -34,10 +34,8 @@
{% 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 primary = option.primary %}
{% set accent = option.accent %}
<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 }}">
{% 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 }}">
{% 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" %}

View File

@ -159,14 +159,12 @@
{% if not palette is mapping %}
{% set palette = palette | first %}
{% endif %}
{% set scheme = palette.scheme | d("default", true) %}
{% set primary = palette.primary %}
{% set accent = palette.accent %}
{% set scheme = palette.scheme | d("default", true) %}
<body
dir="{{ direction }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
data-md-color-primary="{{ primary | replace(' ', '-') }}"
data-md-color-accent="{{ accent | replace(' ', '-') }}"
data-md-color-primary="{{ palette.primary | replace(' ', '-') }}"
data-md-color-accent="{{ palette.accent | replace(' ', '-') }}"
>
{% else %}
<body dir="{{ direction }}">

View File

@ -73,15 +73,13 @@
{% 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 primary = option.primary %}
{% set accent = option.accent %}
{% 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="{{ primary | replace(' ', '-') }}"
data-md-color-accent="{{ accent | replace(' ', '-') }}"
data-md-color-primary="{{ option.primary | replace(' ', '-') }}"
data-md-color-accent="{{ option.accent | replace(' ', '-') }}"
{% if option.toggle %}
aria-label="{{ option.toggle.name }}"
{% else %}