workding memory of dark on the toggle

This commit is contained in:
gws 2024-11-09 23:56:55 +01:00
parent 5bb6ac9d5f
commit 9e5ef69aeb
2 changed files with 56 additions and 44 deletions

View file

@ -41,13 +41,22 @@
{% endif %}
<div class='toggle-switch'>
<div class='toggle-dark'>
<label>
<input type='checkbox' _="on click or load if me.checked
<input type='checkbox' _="on click
log(the first <body/>) then
if me.checked
log('checked')
add .dark to the closest <body/>
else
remove .dark from the closest <body/>
end
end
on load
if (the first <body/> match .dark)
log('loaded as dark') then
set me.checked to true then
log(me)
">
<span class='slider'></span>
</label>