Created
January 17, 2017 03:19
-
-
Save etoxin/0305e0f4dd4670c5d3403a96d7e81e60 to your computer and use it in GitHub Desktop.
Multiline Text With Ellipsis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// font-size needs to be PX | |
// Line height needs to be em. | |
@mixin multilineTextWithEllipsis ($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 */ | |
margin: 0 auto; | |
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