Repository navigation
Add opt-in focusIndicator option - #1368
Open
captbaritone wants to merge 2 commits into
Open
captbaritone wants to merge 2 commits into
captbaritone wants to merge 2 commits into
Conversation
✅ Deploy Preview for tourmaline-kringle-c98715 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: +634 B (+0.13%) Total Size: 491 kB 📦 View Changed
|
captbaritone
force-pushed
the
focus-indicator-option
branch
3 times, most recently
from
October 15, 2026 16:58
28bed0c to
3e3ce17
Compare
When enabled, Webamp draws a focus ring around the focused control for keyboard users (:focus-visible only). The ring is drawn outside the control (outline plus box-shadow, no offset into the element) so skin pixels are never covered, and is two-tone (white inside black) so it holds contrast against any skin. Defaults to off, so Webamp renders exactly as before unless opted in.
captbaritone
force-pushed
the
focus-indicator-option
branch
from
October 15, 2026 17:17
3e3ce17 to
6221a4f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
focusIndicatorconstructor option. When it's on, Webamp draws a focus ring around the focused control for keyboard users.Design constraints
Rendering skins faithfully is the point of Webamp, so:
#webamp *:focus { outline: 0 }still applies, so Webamp renders exactly as before.:focus-visible, so mouse and touch users never see it.outline(no inward offset) plus abox-shadowspread, both of which paint entirely outside the element's box.z-index: 1to keep its ring from being painted over by the next sprite. Every window wrapper has atransformand so is its own stacking context, which means this can't lift a control above another window.input[type="range"]:focus-visibleto beat the existing range-input reset (#webamp input[type="range"]:focus { outline: none }) on specificity.Implementation
focusIndicatoroption inOptions, passed toApp.Apptoggles awebamp-focus-indicatorclass on the#webamproot node.webamp.css.This PR doesn't depend on the other accessibility PRs (#1365 etc.). The ring shows up on whatever is focusable, and #1365 makes all the buttons focusable.
Testing
tsc,eslint,prettier --checkandvitest runpass locally.