|
72 | 72 | </div>
|
73 | 73 |
|
74 | 74 | <!-- Color palette -->
|
75 |
| - {% if not config.theme.palette is mapping %} |
76 |
| - <form class="md-header__option" data-md-component="palette"> |
77 |
| - {% for option in config.theme.palette %} |
78 |
| - {% set scheme = option.scheme | d("default", true) %} |
79 |
| - {% set primary = option.primary | d("indigo", true) %} |
80 |
| - {% set accent = option.accent | d("indigo", true) %} |
81 |
| - <input |
82 |
| - class="md-option" |
83 |
| - data-md-color-media="{{ option.media }}" |
84 |
| - data-md-color-scheme="{{ scheme | replace(' ', '-') }}" |
85 |
| - data-md-color-primary="{{ primary | replace(' ', '-') }}" |
86 |
| - data-md-color-accent="{{ accent | replace(' ', '-') }}" |
| 75 | + {% if config.theme.palette %} |
| 76 | + {% if not config.theme.palette is mapping %} |
| 77 | + <form class="md-header__option" data-md-component="palette"> |
| 78 | + {% for option in config.theme.palette %} |
| 79 | + {% set scheme = option.scheme | d("default", true) %} |
| 80 | + {% set primary = option.primary | d("indigo", true) %} |
| 81 | + {% set accent = option.accent | d("indigo", true) %} |
| 82 | + <input |
| 83 | + class="md-option" |
| 84 | + data-md-color-media="{{ option.media }}" |
| 85 | + data-md-color-scheme="{{ scheme | replace(' ', '-') }}" |
| 86 | + data-md-color-primary="{{ primary | replace(' ', '-') }}" |
| 87 | + data-md-color-accent="{{ accent | replace(' ', '-') }}" |
| 88 | + {% if option.toggle %} |
| 89 | + aria-label="{{ option.toggle.name }}" |
| 90 | + {% else %} |
| 91 | + aria-hidden="true" |
| 92 | + {% endif %} |
| 93 | + type="radio" |
| 94 | + name="__palette" |
| 95 | + id="__palette_{{ loop.index }}" |
| 96 | + /> |
87 | 97 | {% if option.toggle %}
|
88 |
| - aria-label="{{ option.toggle.name }}" |
89 |
| - {% else %} |
90 |
| - aria-hidden="true" |
| 98 | + <label |
| 99 | + class="md-header__button md-icon" |
| 100 | + title="{{ option.toggle.name }}" |
| 101 | + for="__palette_{{ loop.index0 or loop.length }}" |
| 102 | + hidden |
| 103 | + > |
| 104 | + {% include ".icons/" ~ option.toggle.icon ~ ".svg" %} |
| 105 | + </label> |
91 | 106 | {% endif %}
|
92 |
| - type="radio" |
93 |
| - name="__palette" |
94 |
| - id="__palette_{{ loop.index }}" |
95 |
| - /> |
96 |
| - {% if option.toggle %} |
97 |
| - <label |
98 |
| - class="md-header__button md-icon" |
99 |
| - title="{{ option.toggle.name }}" |
100 |
| - for="__palette_{{ loop.index0 or loop.length }}" |
101 |
| - hidden |
102 |
| - > |
103 |
| - {% include ".icons/" ~ option.toggle.icon ~ ".svg" %} |
104 |
| - </label> |
105 |
| - {% endif %} |
106 |
| - {% endfor %} |
107 |
| - </form> |
| 107 | + {% endfor %} |
| 108 | + </form> |
| 109 | + {% endif %} |
108 | 110 | {% endif %}
|
109 | 111 |
|
110 | 112 | <!-- Site language selector -->
|
|
0 commit comments