Created
November 8, 2021 15:24
-
-
Save DominikStyp/ca106bd754f7822809b8b34d8355815f to your computer and use it in GitHub Desktop.
SCSS mixin: Line Clamp for multiple lines (dots for text oferflow)
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
// https://caniuse.com/?search=line-clamp - way around line-clamp needed | |
@mixin ellipsis-for-lines($max-lines: 3) { | |
/* stylelint-disable */ | |
display: -moz-box; | |
display: -webkit-box; | |
text-overflow: ellipsis; | |
-webkit-line-clamp: $max-lines; | |
-webkit-box-orient: vertical; | |
-moz-line-clamp: $max-lines; | |
-moz-box-orient: vertical; | |
/* stylelint-enable */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment