Created
September 7, 2018 19:09
-
-
Save lilithebowman/a38df5b848814107c8a27cc27c3d6fc0 to your computer and use it in GitHub Desktop.
This file contains 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
// Truncates text to a specified number of lines using height, | |
// Note: Only works in webkit browsers. | |
@mixin truncateLines($lineNum: 3, $lineHeight: 1.3, $fontSize: em(18)) { | |
$totalHeight: $lineNum * $lineHeight; | |
-webkit-box-orient: vertical; | |
-webkit-line-clamp: $lineNum; | |
display: -webkit-box; | |
display: block; | |
font-size: $fontSize; | |
height: auto; | |
line-height: $lineHeight; | |
max-height: ($fontSize*$lineHeight*$lineNum); | |
overflow: hidden; | |
text-overflow: ellipsis; | |
word-wrap: break-word; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment