Skip to content

Commit f1bad34

Browse files
committed
fix: text-display should have consistent focus ring to chrome-button
1 parent 9d83108 commit f1bad34

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/js/media-text-display.js

+16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ template.innerHTML = `
2727
pointer-events: auto;
2828
}
2929
30+
/*
31+
Only show outline when keyboard focusing.
32+
https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo
33+
*/
34+
:host(:focus-visible) {
35+
box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
36+
outline: 0;
37+
}
38+
/*
39+
* hide default focus ring, particularly when using mouse
40+
*/
41+
:host(:where(:focus)) {
42+
box-shadow: none;
43+
outline: 0;
44+
}
45+
3046
#container {
3147
/* NOTE: We don't currently have more generic sizing vars */
3248
height: var(--media-text-content-height, auto);

0 commit comments

Comments
 (0)