:host {
  --skeleton-speed: 3s;
  --skeleton-width: 100%;
  --skeleton-height: 20px;
  --skeleton-border-radius: 4px;
}

.skeleton {
  height: var(--skeleton-height);
  width: var(--skeleton-width);
  border-radius: var(--skeleton-border-radius);
  background-color: lightgrey;

  @media (prefers-reduced-motion: reduce) {
    background-repeat: no-repeat;
    background-color: lightgrey;
  }

  @media (prefers-reduced-motion: no-preference) {
    background-repeat: no-repeat;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    background-position: -150% 0;
    animation: loading var(--skeleton-speed) infinite linear both;
  }
}

@keyframes loading {
  from {
    background-position: 250% 0;
  }
  to {
    background-position: -250% 0;
  }
}
