diff --git a/.jules/palette.md b/.jules/palette.md new file mode 100644 index 0000000000..479e9f9798 --- /dev/null +++ b/.jules/palette.md @@ -0,0 +1,4 @@ +## 2024-05-17 - Add aria-label to theme toggle buttons + +**Learning:** Found that empty icon buttons (like theme selectors) generated via Rust server-side templates (`pkgs/id/src/web/templates.rs`) were missing `aria-label` attributes, though they had `title` attributes. Missing these on icon-only interactive elements is a common accessibility anti-pattern. +**Action:** When working on server-rendered templates, especially for interactive elements like theme buttons or inline tools, always verify that `aria-label` attributes are included alongside `title` to ensure they are fully accessible to screen readers. diff --git a/pkgs/id/src/web/templates.rs b/pkgs/id/src/web/templates.rs index a052af54fe..7dd3cfbf2f 100644 --- a/pkgs/id/src/web/templates.rs +++ b/pkgs/id/src/web/templates.rs @@ -93,9 +93,9 @@ pub fn render_main_page_wrapper(content: &str) -> String { html.push_str(" peers\n"); html.push_str(" settings\n"); html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); @@ -458,9 +458,9 @@ pub fn render_editor(doc_id: &str, name: &str, content: &str, hash: &str) -> Str html.push_str(" peers\n"); html.push_str(" settings\n"); html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); @@ -719,9 +719,9 @@ pub fn render_settings(node_id: &str) -> String { html.push_str("
Choose your preferred visual theme.
\n"); html.push_str("