Last active
December 14, 2016 10:20
-
-
Save rankun203/8e3f5e32e327939bc23c1dcf948bd8f7 to your computer and use it in GitHub Desktop.
css-limit-lines.css
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
/* mixin for multiline */ | |
@mixin multiLineEllipsis($lineHeight: 1.2em, $lineCount: 1, $bgColor: white){ | |
overflow: hidden; | |
position: relative; | |
line-height: $lineHeight; | |
max-height: $lineHeight * $lineCount; | |
text-align: justify; | |
margin-right: -1em; | |
padding-right: 1em; | |
&:before { | |
content: '...'; | |
position: absolute; | |
right: 0; | |
bottom: 0; | |
} | |
&:after { | |
content: ''; | |
position: absolute; | |
right: 0; | |
width: 1em; | |
height: 1em; | |
margin-top: 0.2em; | |
background: $bgColor; | |
} | |
} | |
.entry-summary { | |
@include multiLineEllipsis($lineHeight: 1.7em, $lineCount: 2, $bgColor: white); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment