Created
March 6, 2020 11:06
-
-
Save paulmelero/e5cbffd6748d619ffd7eb8bbcba5219a to your computer and use it in GitHub Desktop.
Truncate lines utility classes scss
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
// `.truncate-1-line` and `truncate-2-lines` | |
@each $lines in (1, 2) { | |
:root .truncate-#{$lines}-line#{if($lines > 1, 's', '')} { | |
display: -webkit-box; | |
overflow: hidden; | |
-webkit-line-clamp: $lines; | |
-webkit-box-orient: vertical; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment