From 9daa276c2ee1d158733cac3ab5d38d368a28dd22 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 26 May 2024 10:46:28 -0500 Subject: [PATCH] Better align icons --- layouts/partials/align-toggle.html | 4 ++-- layouts/partials/theme-toggle.html | 2 +- static/theme.mjs | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/layouts/partials/align-toggle.html b/layouts/partials/align-toggle.html index eaa03c5..cb8ccca 100644 --- a/layouts/partials/align-toggle.html +++ b/layouts/partials/align-toggle.html @@ -1,6 +1,6 @@ - + - + diff --git a/layouts/partials/theme-toggle.html b/layouts/partials/theme-toggle.html index 9b86427..9b75064 100644 --- a/layouts/partials/theme-toggle.html +++ b/layouts/partials/theme-toggle.html @@ -5,5 +5,5 @@ - + diff --git a/static/theme.mjs b/static/theme.mjs index 01d4514..1f4498d 100644 --- a/static/theme.mjs +++ b/static/theme.mjs @@ -54,6 +54,13 @@ export class Theme { document.body.classList.remove(`dark-theme`) document.body.classList.remove(`system-theme`) document.body.classList.add(`${this.#theme}-theme`) + const toggler = document.getElementById("theme-toggler") + toggler.setAttribute("title", this.toggleTitle) + toggler.setAttribute("aria-label", "toggle theme") + } + + get toggleTitle() { + return `toggle theme (current theme: ${this.theme})` } get theme() {