Created
October 5, 2020 22:07
-
-
Save mareksuscak/0d49a908216c9e640ddbcc4d33f8feb4 to your computer and use it in GitHub Desktop.
Revisions
-
mareksuscak revised this gist
Oct 5, 2020 . No changes.There are no files selected for viewing
-
mareksuscak created this gist
Oct 5, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ /* Multiline Clamp Mixin */ // Helper Function for Multiline Clamp Mixin @function multiline-block-height($lines, $font-size, $line-height) { @return $lines * floor($font-size * $line-height); } @mixin multiline-clamp($lines: 2, $font-size: 16px, $line-height: 1.4, $fill-space: false) { font-size: $font-size; display: block; display: -webkit-box; line-height: $line-height; -webkit-line-clamp: $lines; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; white-space: normal; max-height: multiline-block-height($lines, $font-size, $line-height); @if ($fill-space) { min-height: multiline-block-height($lines, $font-size, $line-height); } }