summaryrefslogtreecommitdiffstats
path: root/docs/theme/ThemeSwitch.jinja
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-03 07:47:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-03 07:47:33 +0000
commit39bf3544d4064a528a85c21a9069a9cae364a6c1 (patch)
treeaa318bfe1e7816ba9492aff0cdd2454d278f5836 /docs/theme/ThemeSwitch.jinja
parentAdding upstream version 0.45+dfsg. (diff)
downloadjinjax-39bf3544d4064a528a85c21a9069a9cae364a6c1.tar.xz
jinjax-39bf3544d4064a528a85c21a9069a9cae364a6c1.zip
Adding upstream version 0.46.upstream/0.46
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/theme/ThemeSwitch.jinja')
-rw-r--r--docs/theme/ThemeSwitch.jinja36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/theme/ThemeSwitch.jinja b/docs/theme/ThemeSwitch.jinja
new file mode 100644
index 0000000..3543b73
--- /dev/null
+++ b/docs/theme/ThemeSwitch.jinja
@@ -0,0 +1,36 @@
+{#def text=true #}
+
+<button {{ attrs.render(
+ class="cd-theme-switch",
+ data_component="ThemeSwitch",
+ title="Toggle light & dark mode",
+ aria_label="auto",
+ aria_live="polite",
+) }}>
+ <svg
+ class="sun-and-moon"
+ aria-hidden="true"
+ stroke-linecap="round"
+ viewBox="0 0 24 24"
+ >
+ <circle class="sun" cx="12" cy="12" r="6" mask="url(#moon-mask)"></circle>
+ <g class="sun-beams">
+ <line x1="12" y1="1" x2="12" y2="3" />
+ <line x1="12" y1="21" x2="12" y2="23" />
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
+ <line x1="1" y1="12" x2="3" y2="12" />
+ <line x1="21" y1="12" x2="23" y2="12" />
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
+ </g>
+ <mask class="moon" id="moon-mask">
+ <rect x="0" y="0" width="100%" height="100%" fill="white" />
+ <circle cx="24" cy="10" r="6"></circle>
+ </mask>
+ </svg>
+ {% if text -%}
+ <span class="light-text">Light</span>
+ <span class="dark-text">Dark</span>
+ {%- endif %}
+</button>