Last active
December 29, 2015 02:19
-
-
Save imlinus/7599674 to your computer and use it in GitHub Desktop.
ellipsis mixin/placeholder
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 creating a ellipsis (...) when text is too long. | |
// Only call the mixin within media querys, otherwise use the placeholder! | |
@mixin ellipsis { | |
overflow: hidden; | |
white-space: nowrap; | |
text-overflow: ellipsis; | |
} | |
%ellipsis { | |
@include ellipsis; | |
} | |
// usage | |
.notification { | |
width: 100%; | |
height: 50px; | |
line-height: 50px; | |
p { @extend %ellipsis } | |
} |
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
<div class="notification"> | |
<p>This is a longer text that ellipses(!?) when it get's cut!</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment