<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50"> | |
<defs> | |
<style type="text/css"><![CDATA[ | |
#square { | |
fill: red; | |
animation: keyframes 0.01s; | |
animation-fill-mode: forwards; | |
animation-timing-function: step-end; | |
} | |
@keyframes keyframes { | |
0% { fill: pink } | |
/* To prevent flakiness, rapidly switch to green */ | |
1% { fill: green } | |
100% { fill: green } | |
} | |
]]></style> | |
</defs> | |
<rect id="square" width="30" height="30" x="10" y="10"></rect> | |
</svg> |