From 1d3ecff88ed0b63e9c11668dc350f006c0418665 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:34:56 +0000 Subject: [PATCH] Explicitly highlight keyboard shortcuts with `` tags Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/views/mario-game.njk | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 49b0751..6d43941 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -19,3 +19,7 @@ ## 2024-08-06 - Screen Reader Accessible Dynamic Text **Learning:** Dynamic text changes, like game scores, are invisible to screen readers unless explicitly marked. Do not place static text (like instructions) inside an `aria-live` region, as it forces screen readers to unnecessarily repeat the static text every time the dynamic content updates. Extract static text into a separate sibling element. **Action:** Add `aria-live="polite"` to the container of the dynamic value and extract static text out of it. + +## 2024-05-24 - Keyboard Shortcut Highlighting +**Learning:** Explicitly highlighting keyboard shortcuts using semantic tags with physical key styling improves intuitiveness and discoverability. +**Action:** Always wrap key shortcuts in and apply text-shadows to ensure high contrast against dynamic backgrounds. diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index c84e3f2..1b5f911 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -61,6 +61,19 @@ font-size: 16px; font-family: Arial; pointer-events: none; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); + } + + kbd { + background-color: #eee; + color: #333; + padding: 2px 4px; + border-radius: 4px; + border: 1px solid #ccc; + border-bottom: 2px solid #888; + font-family: monospace; + font-weight: bold; + text-shadow: none; } @@ -69,7 +82,7 @@
Score: 0
-
Press Space or ↑ to jump!
+
Press Space or to jump!