discourse/app/assets/stylesheets/common/components/expanding-text-area.scss
Kris 9d53cb3a43
UX: minor expanding textarea fixes (#40910)
There were some minor regressions to the expanding textarea after it was
adjusted in an earlier commit... this adds a new css variable to adjust
padding as needed, fixes some `@value` references and adjusts specific
styles on the /tags page. Also added a modifier class to the child
textarea so it can more easily be separated from normal textareas.

before:
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/c7cb28ce-a626-49e2-90d1-7bbee166b79b"
/>


after:
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/0393c9ba-9ea9-43f1-87ba-5c34076cd1c1"
/>
2026-06-15 15:23:25 -04:00

37 lines
960 B
SCSS
Vendored

.expanding-text-area {
width: 100%;
min-width: 0;
> textarea {
field-sizing: content;
height: auto;
resize: none;
max-width: 100%;
padding: var(--expanding-text-area-padding, 0.5em 0.65em);
min-height: var(--expanding-text-area-min-height, auto);
max-height: var(--expanding-text-area-max-height, none);
}
@supports not (field-sizing: content) {
display: grid;
grid-template-columns: minmax(0, 1fr);
> textarea {
grid-area: 1 / 1;
}
&::after {
content: attr(data-replicated-value) " ";
white-space: pre-wrap;
word-break: break-word;
visibility: hidden;
grid-area: 1 / 1;
box-sizing: border-box;
padding: var(--expanding-text-area-padding, 0.5em 0.65em);
border: 1px solid transparent;
font: inherit;
min-height: var(--expanding-text-area-min-height, auto);
max-height: var(--expanding-text-area-max-height, none);
}
}
}