CSS

  • You can create icon sprite animations using the steps() animation-timing function
    button img {
    object-fit: cover;
    object-position: 0 0;
    }
    [aria-pressed=true] img {
    animation: play 0.5s steps(20) forwards;
    }
    @keyframes play {
    to {
    object-position: 100% 0;
    }
    }