// Single line ellipsis
//
// Allows a text to be truncated and get '...' at the end.
//
// Weight: 6
//
// Style guide: sass.singleline-ellipsis

@mixin singleLineEllipsis() {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// Multi line ellipsis
//
// Allows an text to be truncated and get '...' at the end when it exceeds the
// maximum amount of lines.
// `@mixin multiLineEllipsis($lineHeight: 1.2em, $lineCount: 1, $bgColor: white)`
//
// Weight: 7
//
// Style guide: sass.multiline-ellipsis

@mixin multiLineEllipsis($lineHeight: 1.2em, $lineCount: 1, $bgColor: white){
  overflow: hidden;
  position: relative;
  line-height: $lineHeight;
  max-height: $lineHeight * $lineCount;
  padding-right: 1em;

  &:before {
    content: '...';
    position: absolute;
    right: 0;
    bottom: 0;
  }
  &:after {
    content: '';
    position: absolute;
    right: 0;
    width: 1em;
    height: 1em;
    margin-top: 0.2em;
    background: $bgColor;
  }
}