JSFiddle - React, Tailwind, and code Playground

by Alexander

HTML

<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>

CSS

div {
    width: 150px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

div:after {
    content: "";
    pointer-events: none;
    position: absolute;
    width: 100px;
    height: 100%;
    top: 0;
    right: 0;
    background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    background-image: -moz-linear-gradient(right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    background-image: -ms-linear-gradient(right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    background-image: -o-linear-gradient(right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    background-image: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}