-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Hmmm... We already have focus indicator with blue lines, on the demo page in Chrome and Firefox. |
I don't have the blue focus indicator on my Chromebook. If I pause the video on a lightly-colored scene, I can see a subtle black outline instead. This is the case in v2.5, v3.0, and nightly. |
Just installed Firefox The bug is reproducible. I'll get back with the explanation in a while. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just installed Firefox
(86.0)
to test this, and yes, there's a blue focus indicator, but not in Chrome(89.0.4389.90)
BTW.The bug is reproducible. I'll get back with the explanation in a while.
I've been wondering if Highlight
as a color is not supported correctly in Chrome.
taking extra space when it receives focus */ | ||
|
||
.shaka-controls-button-panel > button:not([disabled]):focus { | ||
outline: 1px solid red; |
There was a problem hiding this comment.
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?
Looks like |
Both Starting to smell like a bug in ChromeOS. |
With these colors, Chrome on Linux appears to behave the same as Windows & ChromeOS. A revision to my earlier statements about Firefox: it is ignoring So I think we should just delete the webkit prefixed color and call it a day. |
I'm going to close this PR and remove the |
Sorry, if this was already closed, But not sure 'Highlight' is a color keyword. If we want to give browser to handle the color. 'invert' might be the keyword value. outline-color: invert; expected to perform a color inversion on the pixels on the screen.
https://drafts.csswg.org/css-ui-3/#valdef-outline-color-invert |
|
That explained it. Is't it? "Highlight ~ Background of selected items" Since we don't have background color for the buttons, outline color will not set. Edited: I overlooked, keyword "invert" browser support is terrible. So no to 'invert' |
Hightight is a real thing you can use. Here's a demo: outline: 1px solid red;
outline: 1px solid Highlight; You'll see light blue, from the highlight color. Compare with this: outline: 1px solid red;
outline: 1px solid foo; You'll see red. Since "foo" is definitely not a recognized color, it will fall back to red. Also, the CSS debugger in Chrome will show a "warning" icon next to the "foo" line, with a tooltip of "invalid property value". It does not do this for |
@joeyparrish although the PR is close, this is what I found. Sorry, I'm a little late, there was a power cut since morning. I tested the focus feature with the following piece of code - <html>
<head>
<style type="text/css">
button:focus+div {
outline: 1px solid Highlight;
outline: 1px solid -webkit-focus-ring-color;
}
</style>
</head>
<body>
<div><button>TEST</button>
<div><br>FOCUS</div>
</div>
</body>
</html> Now, coming to When I removed I'd still recommend having a focus of different color especially for the video player instead of the default blue, setting a browser-independent focus style would probably be a good idea. Let me know what you think. |
Sounds like you came to the same conclusions in your testing: If we're going to change to an explicit color that's not browser-dependent or OS-dependent like |
Didn't notice the changes have been already pushed. |
Sorry I got ahead of you on this! |
Fixes #2863
cc @joeyparrish @michellezhuogg