Commit 0b1662dde37090d25e78a85d67b99dd66240135e

James DiGioia 2019-06-01T18:24:44

Toolbar: Set opacity to 1 when focus is within (#1927) This ensures interacting with the toolbar with the keyboard makes it visible to the user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/plugins/toolbar/prism-toolbar.css b/plugins/toolbar/prism-toolbar.css
index 2b234e1..2d08571 100644
--- a/plugins/toolbar/prism-toolbar.css
+++ b/plugins/toolbar/prism-toolbar.css
@@ -14,6 +14,12 @@ div.code-toolbar:hover > .toolbar {
 	opacity: 1;
 }
 
+/* Separate line b/c rules are thrown out if selector is invalid.
+   IE11 and old Edge versions don't support :focus-within. */
+div.code-toolbar:focus-within > .toolbar {
+	opacity: 1;
+}
+
 div.code-toolbar > .toolbar .toolbar-item {
 	display: inline-block;
 }