Sheida Hedayati Maybe this link will help:
Ultimately, the process requires capturing the CSS as a screen recording / video, then creating a GIF from that captured video.
I'm not aware of another method yet.
Apologies if this has already been explained in this question. I'll remove my answer if it's redundant. I'll read the other answers later.
I can't give perfect ans but
Video or gif is running collection of photos/frames/image
Html + css animation is mathmatical function that creating image.
Manual or progarmatical
You have only one way.
Runing code -> capture img/ videos -> making gif.
If u need small level project
U can do manual
Take screen shot at every step .
If too long animation take screen record
Photo or video make to gif 90% possible using android apps .(im alredy do it . More app working but qulity )
Gif memory is more then html + css .