You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: code-input.css
+36-10Lines changed: 36 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,14 @@ code-input {
20
20
top:0;
21
21
left:0;
22
22
23
-
color: black;
23
+
/* CSS variables rather than inline styles used for values synced from JavaScript
24
+
to keep low precedence and thus overridability
25
+
The variable names may change and are for internal use. */
26
+
/* --code-input_highlight-text-color: Set by JS to be base text color of pre code element */
27
+
/* --code-input_no-override-color: Set by JS for very short time to get whether color has been overriden */
28
+
color:var(--code-input_no-override-color, black);
29
+
/* --code-input_default-caret-color: Set by JS to be same as color property - currentColor won't work because it's lazily evaluated so gives transparent for the textarea */
line-height:1.5; /* Inherited to child elements */
38
46
tab-size:2;
39
-
caret-color: darkgrey;
40
47
white-space: pre;
41
48
padding:0!important; /* Use --padding to set the code-input element's padding */
42
49
display: grid;
43
50
grid-template-columns:100%;
44
51
grid-template-rows:100%;
45
52
}
46
53
47
-
code-input* {
54
+
code-input:not(.code-input_dialog-container*) {
48
55
box-sizing: content-box; /* Make height, width work consistently no matter the box-sizing of ancestors; dialogs can be styled as wanted so are excluded. */
49
56
}
50
57
@@ -56,25 +63,33 @@ code-input textarea, code-input:not(.code-input_pre-element-styled) pre code, co
stylesheetI: 0,// Increments to give different classes to each code-input element so they can have custom styles synchronised internally without affecting the inline style
156
+
155
157
/**
156
158
* Please see `codeInput.templates.prism` or `codeInput.templates.hljs`.
157
159
* Templates are used in `<code-input>` elements and once registered with
@@ -445,6 +447,16 @@ var codeInput = {
445
447
*/
446
448
dialogContainerElement=null;
447
449
450
+
/**
451
+
* Like style attribute, but with a specificity of 1
452
+
* element, 1 class. Present so styles can be set on only
453
+
* this element while giving other code freedom of use of
* Show some instructions to the user only if they are using keyboard navigation - for example, a prompt on how to navigate with the keyboard if Tab is repurposed.
551
616
* @param {string} instructions The instructions to display only if keyboard navigation is being used. If it's blank, no instructions will be shown.
0 commit comments