mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Allow to define color schemes without toggles
This commit is contained in:
parent
7d405c4a1b
commit
2c973e1755
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -223,7 +223,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.7353b375.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.56defda5.min.js' | url }}"></script>
|
||||||
{% for path in config["extra_javascript"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -33,9 +33,11 @@
|
|||||||
{% 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 }}">
|
||||||
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden>
|
{% if option.toggle %}
|
||||||
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
|
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden>
|
||||||
</label>
|
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -131,8 +131,9 @@ export function mountPalette(
|
|||||||
|
|
||||||
/* Toggle visibility */
|
/* Toggle visibility */
|
||||||
for (let index = 0; index < inputs.length; index++) {
|
for (let index = 0; index < inputs.length; index++) {
|
||||||
const label = inputs[index].nextElementSibling as HTMLElement
|
const label = inputs[index].nextElementSibling
|
||||||
label.hidden = palette.index !== index
|
if (label instanceof HTMLElement)
|
||||||
|
label.hidden = palette.index !== index
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -79,14 +79,16 @@
|
|||||||
name="__palette"
|
name="__palette"
|
||||||
id="__palette_{{ loop.index }}"
|
id="__palette_{{ loop.index }}"
|
||||||
/>
|
/>
|
||||||
<label
|
{% if option.toggle %}
|
||||||
class="md-header__button md-icon"
|
<label
|
||||||
title="{{ option.toggle.name }}"
|
class="md-header__button md-icon"
|
||||||
for="__palette_{{ loop.index0 or loop.length }}"
|
title="{{ option.toggle.name }}"
|
||||||
hidden
|
for="__palette_{{ loop.index0 or loop.length }}"
|
||||||
>
|
hidden
|
||||||
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
|
>
|
||||||
</label>
|
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
5
typings/_/index.d.ts
vendored
5
typings/_/index.d.ts
vendored
@ -50,6 +50,11 @@ declare global {
|
|||||||
*/
|
*/
|
||||||
const __search: GlobalSearchConfig | undefined
|
const __search: GlobalSearchConfig | undefined
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Global function to prefix storage items
|
||||||
|
*/
|
||||||
|
function __prefix(key: string): string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Analytics
|
* Google Analytics
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user