JSFiddle - React, Tailwind, and code Playground

by the94air

HTML

<div></div>
<div></div>
<div></div>

CSS

div {
  height: 40px;
  width: 100%;
  background: #eee;
  margin-bottom: 1rem;
  border-radius: .25rem;
  position: relative;
  overflow: hidden;
}

div::before {
  content: '';
  display: block;
  position: absolute;
  left: -150px;
  top: 0;
  height: 100%;
  width: 150px;
  background: linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%);
  animation: load 1800ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  background-repeat: no-repeat;
}

@keyframes load {
  from {
    left: -150px;
  }
  to   {
    left: 100%;
  }
}