.GrowingTextarea { display: block; width: 100%; position: relative; .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; &::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; } }