diff --git a/.Jules/palette.md b/.Jules/palette.md index 49b0751..d554746 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. + +## 2025-10-18 - Keyboard Shortcut Highlight +**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..f936f74 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -62,6 +62,21 @@ font-family: Arial; pointer-events: none; } + + kbd { + background-color: #f7f7f7; + border: 1px solid #ccc; + border-radius: 3px; + box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 0 0 2px #fff inset; + color: #333; + display: inline-block; + font-family: monospace; + font-size: 14px; + line-height: 1.4; + margin: 0 .1em; + padding: .1em .6em; + text-shadow: 0 1px 0 #fff; + } @@ -69,7 +84,7 @@
Score: 0
-
Press Space or ↑ to jump!
+
Press Space or to jump!