webapp/src/components/_shared/GrowingTextarea/GrowingTextarea.module.scss

77 lines
1.3 KiB
SCSS
Raw Normal View History

2023-05-11 11:33:01 +00:00
.GrowingTextarea {
display: block;
width: 100%;
position: relative;
2023-05-11 11:33:01 +00:00
.growWrap {
display: grid;
width: 100%;
&::after {
content: attr(data-replicated-value);
visibility: hidden;
transition: height 0.3s linear;
}
.textInput {
margin-bottom: 0;
border: none;
resize: none;
overflow: hidden;
2023-05-11 11:33:01 +00:00
&::placeholder {
color: #858585;
}
&:focus,
&:focus-visible,
&:active {
border: none;
outline: none;
box-shadow: none;
}
}
&::after,
& .textInput {
/* Identical styling required!! */
white-space: pre-wrap;
word-wrap: break-word;
overflow: hidden;
grid-area: 1 / 1 / 2 / 2;
width: 100%;
padding: 0;
}
}
.maxLength {
opacity: 1;
position: absolute;
right: 0.6rem;
bottom: -1.2rem;
font-size: 1.1rem;
border: 3px solid rgba(#ccc, 0.5);
padding: 0.5rem;
border-radius: 1.3rem;
line-height: 1;
user-select: none;
transition: opacity 0.3s ease-in-out;
background: rgba(255, 255, 255, 0.8);
&.visible {
opacity: 1;
}
&.limited {
animation: blink 0.8s;
animation-iteration-count: 2;
}
}
}
@keyframes blink {
50% {
border-color: #000;
}
2023-05-11 11:33:01 +00:00
}