cristinafsanz
10/11/2019 - 7:58 AM

Truncate text more than 2 lines (ellipsis)

@mixin truncate-two-lines($lineheight) {
  /* Truncate if more than 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;

  /* number of lines to show */
  -webkit-line-clamp: 2;

  /* fallback */
  line-height: $lineheight rem;
  max-height: $lineheight*2 rem;
}
.title {
  @include truncate-two-lines(2);
}