@import url('./TextInput.less');

.AutoExpand {
  display: grid;
  grid-template-columns: 100%;
  width: 100%;

  &::before,
  > .AutoExpand-shim,
  > textarea {
    grid-area: ~'1 / 1 / 2 / 2';
  }

  &::before,
  > .AutoExpand-shim {
    .TextInput;

    content: attr(data-value) ' ';
    overflow-wrap: break-word;
    visibility: hidden;
    white-space: pre-wrap;
  }

  > btu-textarea-input > textarea,
  > textarea {
    field-sizing: content; /* stylelint-disable-line property-no-unknown */
    overflow: hidden;
  }

  &.is-noShim {
    &::before,
    > .AutoExpand-shim {
      display: none;
    }
  }
}
