working toggle via hyperscript

This commit is contained in:
gws 2024-11-09 22:31:00 +01:00
parent df35f5e736
commit 5bb6ac9d5f
2 changed files with 24 additions and 49 deletions

View file

@ -40,15 +40,20 @@
src="/flag-for-united-kingdom-svgrepo-com.svg"></a>
{% endif %}
<button _="on click toggle .dark on the closest <body/>"> toggle </button>
<div class='toggle-switch'>
<label>
<input type='checkbox'>
<input type='checkbox' _="on click or load if me.checked
log('checked')
add .dark to the closest <body/>
else
remove .dark from the closest <body/>
">
<span class='slider'></span>
</label>
</div>
<!-- if i am <:checked/> -->
</nav>
{% endmacro render_header %}