Last active
March 4, 2021 21:56
-
-
Save isao/fdbd8fa094e6389b1c0b09b2df753d9d to your computer and use it in GitHub Desktop.
dma/app/styles/core/mixins/line-clamp.scss
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
/// | |
/// Line-Clamp | |
/// | |
/// https://medium.com/@elad/trimming-multi-lines-in-css-5ae59d5e6d84 | |
/// | |
@mixin line-clamp($lines: null) { | |
@if $lines != null { | |
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */ | |
-webkit-line-clamp: $lines; | |
-webkit-box-orient: vertical; /* stylelint-disable-line property-no-vendor-prefix */ | |
overflow: hidden; | |
} | |
@else { | |
text-overflow: ellipsis; | |
white-space: nowrap; | |
overflow: hidden; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for posting this