JSFiddle - React, Tailwind, and code Playground
HTML
<p>Test Test Test Test Test</p>
CSS
p {
text-overflow: ellipsis;
width: 140px;
overflow: hidden;
white-space: nowrap;
margin: 25px 0;
}
span {
display: inline-block;
height: 20px;
width: 50px;
position: absolute;
left: 90px;
background: -moz-linear-gradient(right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, right top, left top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(255,255,255,0),rgba(255,255,255,1)); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(255,255,255,1) 100%,rgba(255,255,255,0) 0%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(255,255,255,1) 100%,rgba(255,255,255,0) 0%); /* IE10+ */
background: linear-gradient(to right, rgba(255,255,255,1) 100%,rgba(255,255,255,0) 0%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
}
JavaScript
$("p").append("<span />");