add theme picker

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-03-16 02:13:11 +01:00
parent a4337b3514
commit 49f457cda7
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
5 changed files with 122 additions and 21 deletions

View file

@ -5,3 +5,9 @@
#let site-wrapper = html.elem.with("site-wrapper")
#let site-container = html.elem.with("site-container")
/// Element used to group radio buttons for theme selection.
/// label is the aria-label, for accessibility (ie screen reader)
#let theme-picker(label: "Theme Picker", body) = {
// Role 'radiogroup' is needed because of bug in chromium with screenreaders (https://lyra.horse/blog/2025/08/you-dont-need-js/#fn:10)
html.elem("theme-picker", attrs: (aria-label: label, role: "radiogroup"), body)
}