Skip to content

Instantly share code, notes, and snippets.

@igorescobar
Last active September 6, 2016 15:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
// e.g: @include truncate(.875em, 1.4, 10)
@mixin truncate($font-size, $line-height, $lines-to-show) {
display: block; // Fallback for non-webkit
display: -webkit-box;
max-width: 400px;
height: $font-size*$line-height*$lines-to-show; // Fallback for non-webkit
font-size: $font-size;
line-height: $line-height;
-webkit-line-clamp: $lines-to-show;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment