Skip to content

Commit a142a7b

Browse files
committed
Enable wrapping to be enabled/disabled by CSS properties of code-input
1 parent 9659416 commit a142a7b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

code-input.css

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ code-input {
2121
tab-size: 2;
2222
caret-color: darkgrey;
2323
white-space: pre;
24+
word-spacing: normal;
25+
word-break: normal;
26+
word-wrap: normal;
27+
2428
padding: 0!important; /* Use --padding to set the code-input element's padding */
2529
display: grid;
2630
grid-template-columns: 100%;
@@ -62,6 +66,11 @@ code-input textarea, code-input pre, code-input pre * {
6266
line-height: inherit!important;
6367
tab-size: inherit!important;
6468
text-align: inherit!important;
69+
70+
white-space: inherit!important;
71+
word-spacing: inherit!important;
72+
word-break: inherit!important;
73+
word-wrap: inherit!important;
6574
}
6675

6776
/* Make changing the text direction propogate */
@@ -78,7 +87,7 @@ code-input textarea[dir=rtl] + pre {
7887
}
7988

8089

81-
code-input textarea, code-input pre {
90+
code-input textarea, code-input pre, code-input pre code {
8291
/* In the same place */
8392
grid-column: 1;
8493
grid-row: 1;
@@ -104,14 +113,6 @@ code-input textarea::placeholder {
104113
color: lightgrey;
105114
}
106115

107-
/* Can be scrolled */
108-
code-input textarea, code-input pre {
109-
white-space: inherit;
110-
word-spacing: normal;
111-
word-break: normal;
112-
word-wrap: normal;
113-
}
114-
115116
/* No resize on textarea; transfer outline on focus to code-input element */
116117
code-input textarea {
117118
resize: none;

0 commit comments

Comments
 (0)