Skip to content

Commit 9ca3a13

Browse files
committed
Make fallback textarea size correctly with autogrow plugin (Fixes #213)
1 parent 6061890 commit 9ca3a13

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

plugins/autogrow.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,17 @@ code-input.code-input_autogrow_width:has(.code-input_find-and-replace_dialog:not
6161
code-input.code-input_autogrow_height:has(.code-input_find-and-replace_dialog:not(.code-input_find-and-replace_hidden-dialog)) {
6262
--code-input_autogrow_internal-min-height: 170px;
6363
}
64+
65+
/* Autogrow doesn't work with fallback textarea (since its functioning depends on
66+
synchronisation to pre code element). Stick to the minimum size. */
67+
68+
/* At least one line high, leave space for no-JS instructions */
69+
code-input.code-input_autogrow_height:has(textarea[data-code-input-fallback]) {
70+
--code-input_autogrow_internal-min-height: calc(4em + var(--padding-top, 16px) + var(--padding-bottom, 16px)); /* For browsers that don't support 1lh */
71+
--code-input_autogrow_internal-min-height: calc(1lh + 2em + var(--padding-top, 16px) + var(--padding-bottom, 16px)); /* So minimum height possible while containing highlighted code */
72+
height: var(--code-input_autogrow_true-min-height);
73+
}
74+
code-input textarea[data-code-input-fallback] {
75+
height: calc(var(--code-input_autogrow_true-min-height) - var(--padding-top, 16px) - var(--padding-bottom, 16px) - 2em)!important; /* So minimum height possible while containing highlighted code */
76+
min-height: calc(100% - var(--padding-top, 16px) - var(--padding-bottom, 16px) - 2em);
77+
}

0 commit comments

Comments
 (0)