Skip to content

Commit 335b875

Browse files
committed
fix: have improved styling with host-context and chrome-range
1 parent f1bad34 commit 335b875

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/js/media-chrome-range.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,17 @@ template.innerHTML = `
101101
${trackStyles}
102102
}
103103
104-
/* Eventually want to move towards different styles for focus-visible
105-
https://github.com/WICG/focus-visible/blob/master/src/focus-visible.js
106-
Youtube appears to do this by de-focusing a button after a button click */
104+
/*
105+
* set input to focus-visible, unless host-context is available (in chrome)
106+
* in which case we can have the focus ring be on the host itself
107+
*/
108+
:host-context([media-keyboard-control]):host(:focus),
109+
:host-context([media-keyboard-control]):host(:focus-within) {
110+
box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
111+
}
112+
:host-context([media-keyboard-control]) input[type=range]:focus-visible {
113+
box-shadow: none;
114+
}
107115
input[type=range]:focus-visible {
108116
box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
109117
}

0 commit comments

Comments
 (0)