InfoPanel: make snippets keyboard-navigable and autoselected
Code snippets can now be navigated to be keyboard. Additionally, focusing this way or by single-clicking will select the entire snippet contents by default, then after a 50ms delay, allow for normal text selection. This is a better experience for copying, especially on mobile.
This commit is contained in:
@@ -87,10 +87,27 @@
|
||||
.snippet {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.snippet pre {
|
||||
text-overflow: ellipsis;
|
||||
color: black;
|
||||
user-select: all;
|
||||
-moz-user-select: all;
|
||||
-webkit-user-select: all;
|
||||
}
|
||||
|
||||
.snippet pre:focus {
|
||||
animation: select 50ms step-end forwards;
|
||||
}
|
||||
|
||||
@keyframes select {
|
||||
to {
|
||||
user-select: text;
|
||||
-moz-user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
}
|
||||
|
||||
.snippet button {
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user