JSFiddle - React, Tailwind, and code Playground
HTML
<p class="long">Hi my name is John Doe</p>
<p class="short">Yeah!</p>
CSS
p {
width: 100px;
background-color: #CCC;
overflow-style: marquee-line;
overflow-x:-webkit-marquee;
-webkit-marquee-direction: backwards;
-webkit-marquee-style: alternate;
-webkit-marquee-speed: normal;
-webkit-marquee-increment: 1px;
-webkit-marquee-repetition: infinite;
white-space: nowrap;
}