Skip to content

Commit 3bbd766

Browse files
committed
Remove padding from unregistered code-input element when fallback textarea present (#181)
1 parent 54d7cba commit 3bbd766

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

code-input.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ code-input:not(.code-input_registered)::after {
165165
height: 2em;
166166
}
167167

168-
code-input:not(.code-input_registered) textarea {
169-
/* Don't overlap with message */
170-
min-height: calc(100% - var(--padding, 16px) * 2 - 2em);
171-
}
172-
173168
code-input:not(.code-input_loaded) pre, code-input:not(.code-input_loaded) textarea:not([data-code-input-fallback]) {
174169
opacity: 0;
175170
}
@@ -246,9 +241,15 @@ code-input:not(:has(.code-input_keyboard-navigation-instructions:empty)):has(tex
246241

247242
/* No JavaScript fallback - styles to override all previous */
248243

244+
code-input:has(textarea[data-code-input-fallback]) {
245+
padding: 0!important; /* Padding now in the textarea */
246+
box-sizing: content-box;
247+
}
249248
code-input textarea[data-code-input-fallback] {
250249
overflow: auto;
251250
background-color: inherit;
252251
color: inherit;
253-
height: max-content;
252+
253+
/* Don't overlap with message */
254+
min-height: calc(100% - var(--padding, 16px) * 2 - 2em);
254255
}

0 commit comments

Comments
 (0)