From 85ed86a8d5deddf4a561e97f47479094cdb80742 Mon Sep 17 00:00:00 2001 From: 0m364 <13804150+0m364@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:06:41 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20[Anchor=20Tag=20as=20?= =?UTF-8?q?Button=20Accessibility]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added `role="button"` and `aria-haspopup="dialog"` to the `a#sitrep-btn` tags across the site and implemented spacebar activation in `modal.js` to ensure the link properly behaves like a native button for keyboard users. --- .Jules/palette.md | 4 ++++ concepts.html | 2 +- contact.html | 2 +- modal.js | 6 ++++++ products.html | 2 +- server.log | 5 +++++ 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 server.log diff --git a/.Jules/palette.md b/.Jules/palette.md index 7c7c523..8fe1e53 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -29,3 +29,7 @@ ## 2026-06-12 - Robust Skip-to-Content Links **Learning:** Adding a "Skip to main content" link is a critical accessibility requirement for keyboard users. To make it robust, it needs to be hidden visually but appear when focused using `transform: translateY(-100%)` instead of magic pixel numbers, and the target container (e.g., `
`) must have a matching `id` and `tabindex="-1"` so it can programmatically receive focus across all browsers. **Action:** Always include a visually hidden 'Skip to main content' link immediately after the opening `` tag. Set the main content container with an `id` and explicitly `tabindex="-1"`. + +## 2026-07-02 - Anchor Tags as Buttons Accessibility +**Learning:** Using `` tags with `href="#"` to trigger JavaScript actions (like opening a modal) without navigating away is a common pattern. However, screen readers treat them as links, and natively, they only trigger on the `Enter` key. Keyboard users and screen reader users expect elements that perform actions to be identified and behave as buttons (triggering on both `Enter` and `Space`). +**Action:** When using `` tags for actions, always add `role="button"` and `aria-haspopup="dialog"` (if opening a modal). Furthermore, add a JavaScript `keydown` listener to intercept the `Space` key (`e.preventDefault()` to stop scrolling) and execute the action, bringing it in line with native `