{"id":2758,"date":"2024-06-18T07:31:23","date_gmt":"2024-06-18T13:31:23","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=2758"},"modified":"2024-06-18T07:31:24","modified_gmt":"2024-06-18T13:31:24","slug":"single-css-keyframe-tricks-are-magic","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/single-css-keyframe-tricks-are-magic\/","title":{"rendered":"Single CSS Keyframe Tricks are Magic"},"content":{"rendered":"\n<p>What happens with a CSS <code>@keyframe<\/code> animation like this when called? <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-keyword\">@keyframes<\/span> pulse {\n  50% {\n    <span class=\"hljs-attribute\">scale<\/span>: <span class=\"hljs-number\">1.5<\/span>;\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>There is only one &#8220;keyframe&#8221; there at 50%. So what happens at 0% through the animation? The <code>scale<\/code> property is&#8230; whatever it already was. And at 100%? Back to whatever it already was. Assuming the default scale of <code>1<\/code>, it will grow the element then shrink back down again. So little code! <\/p>\n\n\n\n<p>David East and Adam Argyle dig into this in the video <a href=\"https:\/\/www.youtube.com\/watch?v=aLqScpKlzRo\">Single CSS keyframe tricks are magic<\/a> and <a href=\"https:\/\/codepen.io\/davideast\/pen\/MWxvzjm\">have a great demo<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/@badatcsspod\"><\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/@badatcsspod\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What happens with a CSS @keyframe animation like this when called? There is only one &#8220;keyframe&#8221; there at 50%. So what happens at 0% through the animation? The scale property is&#8230; whatever it already was. And at 100%? Back to whatever it already was. Assuming the default scale of 1, it will grow the element [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[100,7],"class_list":["post-2758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-animation","tag-css"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-18-at-9.29.36%E2%80%AFAM.png?fit=1730%2C1098&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/2758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=2758"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/2758\/revisions"}],"predecessor-version":[{"id":2759,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/2758\/revisions\/2759"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/2760"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=2758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=2758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=2758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}