Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ui focus indicator for keyboard navigation #3235

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ui/less/containers.less
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@
}
}

/* Offset is set to negative in order to prevent element from
taking extra space when it receives focus */

.shaka-controls-button-panel > button:not([disabled]):focus {
outline: 1px solid red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we have focus styles already. Could those could be fixed instead?

https://github.com/google/shaka-player/blob/e7173960a7249fdb369d942976d2598a7374d981/ui/less/buttons.less#L89-L107

outline-offset: -1px;
}

/* The container for the giant play button. Sits above (Y axis) the
* other video controls and seek bar, in the middle of the video frame, on top
* of (Z axis) the video. */
Expand Down
6 changes: 6 additions & 0 deletions ui/less/range_elements.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@

/* Until we set a gradient background in JS, this will be the track color. */
background: @track-default-color;

/* Add a thin outline over `range` when it receives focus */
input:in-range:not([disabled]):focus {
outline: 1px solid red;
outline-offset: -1px;
}
}

/* The "track" is the pseudo-element inside the range element which represents
Expand Down