Add selector for site theme
This commit is contained in:
parent
f68060aed5
commit
aabd31ff90
|
|
@ -12,6 +12,7 @@ module.exports = {
|
|||
title: "SuperMinimalCSS",
|
||||
description: "Superminimal Superminimal",
|
||||
lang: "fr",
|
||||
theme: "auto", // "light", "dark" or "auto"
|
||||
feed: "feed.xml",
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
|
|
@ -53,9 +53,12 @@
|
|||
<link rel="icon" href="/images/meta/favicon.ico" sizes="any">
|
||||
<link rel="icon" href="/images/meta/favicon.svg" type="image/svg+xml">
|
||||
|
||||
{% if site.theme == "auto" %}
|
||||
<meta name="color-scheme" content="light dark">
|
||||
|
||||
<script>{% include "js/theme-toggle.js" %}</script>
|
||||
{% else %}
|
||||
<meta name="color-scheme" content={{site.theme}}>
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
{% fetch "https://cdn.jsdelivr.net/npm/theme-toggles@4.10.1/css/around.min.css", "css" %}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<button
|
||||
{% if site.theme == "auto" %}
|
||||
<button
|
||||
class="theme-toggle"
|
||||
type="button"
|
||||
title="{{Term.Site.ToggleTheme}}"
|
||||
aria-label="{{Term.Site.ToggleTheme}}"
|
||||
>
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
aria-hidden="true"
|
||||
|
|
@ -28,4 +29,5 @@
|
|||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</button>
|
||||
</button>
|
||||
{% endif %}
|
||||
Loading…
Reference in a new issue