JSFiddle - React, Tailwind, and code Playground
HTML
<h2>select some text</h2>
CSS3 animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components, a style describing the CSS animation and a set of keyframes that indicate the start and end states of the animation's style, as well as possible intermediate waypoints along the way.
CSS
body{ color:blue; }
@keyframes selection{
50%{ color:red; }
}
@-webkit-keyframes selection{
50%{ color:red;; }
}
/* Custom Selection Styles */
::selection{ background:rgba(0,0,0,0.2); animation:0.4s selection infinite; }
::-moz-selection{ background:rgba(0,0,0,0.2); animation:0.4s selection infinite;}
::-webkit-selection{ background:rgba(0,0,0,0.2); -webkit-animation:0.4s selection infinite; }