You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
803 B
CSS

/* HACK: https://css-tricks.com/the-cleanest-trick-for-autogrowing-textareas/ */
.wrapper {
display: grid;
width: 100%;
height: 100%;
}
/* No nesting here, because we want to keep precedence as low as possible */
.editable, .dummy {
grid-area: 1 / 1 / 2 / 2;
display: inline-block;
box-sizing: border-box;
white-space: normal;
overflow: hidden;
overflow-wrap: normal;
font: {
family: inherit;
size: inherit;
weight: inherit;
style: inherit;
};
}
.dummy {
visibility: hidden;
width: max-content; /* NOTE: This prevents the pseudo-element from line-wrapping when the overall page content is bigger than the viewport, which is necessary to get consistent behaviour with regular elements. */
}
.editable {
border: none;
resize: none;
margin: 0;
width: 100%;
height: 100%;
}