diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Add a light and dark theme toggle
The button is emitted hidden and only revealed by the script, so a browser without JavaScript never shows a control that cannot work and the page keeps tracking the system theme.
Diffstat (limited to 'source')
-rw-r--r--source/ui-shared.c3
1 file changed, 3 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index 83454fe..88e5075 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1082,6 +1082,9 @@ static void print_header(void)
html_txt(ctx.cfg.root_desc);
html("</p>\n");
}
+
+ html("<button type='button' class='theme-toggle' hidden "
+ "aria-label='Toggle color theme'></button>\n");
html("</header>\n");
}