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
+27-26Lines changed: 27 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,7 @@
6
6
code-input {
7
7
/* Allow other elements to be inside */
8
8
display: block;
9
-
overflow-y: auto;
10
-
overflow-x: auto;
9
+
overflow: hidden;
11
10
position: relative;
12
11
top:0;
13
12
left:0;
@@ -22,6 +21,10 @@ code-input {
22
21
tab-size:2;
23
22
caret-color: darkgrey;
24
23
white-space: pre;
24
+
word-spacing: normal;
25
+
word-break: normal;
26
+
word-wrap: normal;
27
+
25
28
padding:0!important; /* Use --padding to set the code-input element's padding */
26
29
display: grid;
27
30
grid-template-columns:100%;
@@ -38,21 +41,16 @@ code-input textarea, code-input:not(.code-input_pre-element-styled) pre code, co
38
41
margin:0px!important;
39
42
padding:var(--padding,16px)!important;
40
43
border:0;
41
-
min-width:calc(100%-var(--padding) *2);
42
-
min-height:calc(100%-var(--padding) *2);
44
+
width:calc(100%-var(--padding) *2);
45
+
height:calc(100%-var(--padding) *2);
43
46
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. */
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. */
189
+
191
190
padding-left:10px;
192
191
margin:0;
193
192
text-wrap: balance;
194
-
overflow:hidden;
193
+
overflow:auto;
195
194
text-overflow: ellipsis;
196
195
width:calc(100%-12px);
196
+
box-sizing: content-box; /* Make height, width work consistently no matter the box-sizing of ancestors. */
Copy file name to clipboardExpand all lines: code-input.d.ts
+5-13Lines changed: 5 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -295,11 +295,11 @@ export class Template {
295
295
* @param {boolean} preElementStyled - is the `<pre>` element CSS-styled as well as the `<code>` element? If true, `<pre>` element's scrolling is synchronised; if false, `<code>` element's scrolling is synchronised.
296
296
* @param {boolean} isCode - is this for writing code? If true, the code-input's lang HTML attribute can be used, and the `<code>` element will be given the class name 'language-[lang attribute's value]'.
297
297
* @param {false} includeCodeInputInHighlightFunc - Setting this to true passes the `<code-input>` element as a second argument to the highlight function.
298
-
* @param {boolean} autoDisableDuplicateSearching - Leaving this as true uses code-input's default fix for preventing duplicate results in Ctrl+F searching from the input and result elements, and setting this to false indicates your highlighting function implements its own fix. The default fix works by moving text content from elements to CSS `::before` pseudo-elements after highlighting.
299
298
* @param {codeInput.Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.Plugin`
299
+
* @param {boolean} addPlaceholderToLastEmptyLine - Setting this to true adds a space character to the end of the `<code>` element before highlighting when its last line is empty, ensuring that last line is displayed and aligns with the editing.
* **When `includeCodeInputInHighlightFunc` is `true`, `highlight` takes two parameters: the `<pre><code>` element, and the `<code-input>` element.**
305
305
*
@@ -309,25 +309,17 @@ export class Template {
309
309
* @param {boolean} preElementStyled - is the `<pre>` element CSS-styled as well as the `<code>` element? If true, `<pre>` element's scrolling is synchronised; if false, `<code>` element's scrolling is synchronised.
310
310
* @param {boolean} isCode - is this for writing code? If true, the code-input's lang HTML attribute can be used, and the `<code>` element will be given the class name 'language-[lang attribute's value]'.
311
311
* @param {true} includeCodeInputInHighlightFunc - Setting this to true passes the `<code-input>` element as a second argument to the highlight function.
312
-
* @param {boolean} autoDisableDuplicateSearching - Leaving this as true uses code-input's default fix for preventing duplicate results in Ctrl+F searching from the input and result elements, and setting this to false indicates your highlighting function implements its own fix. The default fix works by moving text content from elements to CSS `::before` pseudo-elements after highlighting.
313
312
* @param {codeInput.Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.Plugin`
313
+
* @param {boolean} addPlaceholderToLastEmptyLine - Setting this to true adds a space character to the end of the `<code>` element before highlighting when its last line is empty, ensuring that last line is displayed and aligns with the editing.
0 commit comments