Skip to content

Instantly share code, notes, and snippets.

@mrilikecoding
Created January 30, 2014 19:34
Show Gist options
  • Save mrilikecoding/8717007 to your computer and use it in GitHub Desktop.
Save mrilikecoding/8717007 to your computer and use it in GitHub Desktop.
converts any text into a single line with a fade out on the right side
@mixin text-overflow-fade($background-color: #fff, $text-width: 100%, $fade-size: 30%) {
   width: $text-width;
   overflow: hidden;
   white-space: nowrap;
   position: relative;
   &:after {
       content: '';
       position: absolute;
       top: 0;
       right: 0;
       width: $fade-size;
       height: 100%;
       @include background-image(linear-gradient(left, rgba(255,255,255,0) 0%, $background-color 80%, $background-color 100%));
       pointer-events: none;
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment