<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSS Animation Archives - The NOKIA Blog</title>
	<atom:link href="https://thenokiablog.com/tag/css-animation/feed/" rel="self" type="application/rss+xml" />
	<link>https://thenokiablog.com/tag/css-animation/</link>
	<description></description>
	<lastBuildDate>Fri, 07 Nov 2025 15:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://thenokiablog.com/wp-content/uploads/2024/03/cropped-Cjdowner-Cryptocurrency-Flat-ICON-ICX.512-32x32.png</url>
	<title>CSS Animation Archives - The NOKIA Blog</title>
	<link>https://thenokiablog.com/tag/css-animation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Smashing Animations Part 6: Magnificent SVGs With &#8220; And CSS Custom Properties</title>
		<link>https://thenokiablog.com/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties/</link>
		
		<dc:creator><![CDATA[Mister Nokia]]></dc:creator>
		<pubDate>Fri, 07 Nov 2025 15:00:00 +0000</pubDate>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Animation]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">https://thenokiablog.com/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties/</guid>

					<description><![CDATA[<p>SVG is one of those web technologies that&#8217;s both elegant and, at times, infuriating. In this...</p>
<p>The post <a href="https://thenokiablog.com/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties/">Smashing Animations Part 6: Magnificent SVGs With &#8220; And CSS Custom Properties</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="c-garfield-summary">
<section aria-label="Quick summary" class="article__summary"><span id="article__start" class="summary__heading" aria-hidden="true"></span>SVG is one of those web technologies that&rsquo;s both elegant and, at times, infuriating. In this article, pioneering author and web designer Andy Clarke explains his technique for animating SVG elements that are hidden in the Shadow DOM.</section>
</div>
<p>I explained recently how I use <code>&lt;symbol&gt;</code>, <code>&lt;use&gt;</code>, and CSS Media Queries to develop what I call adaptive SVGs. Symbols let us define an element once and then <em>use</em> it again and again, making SVG animations easier to maintain, more efficient, and lightweight.</p>
<p>Since I wrote that explanation, I&rsquo;ve designed and implemented new Magnificent 7 animated graphics across my website. They play on the web design pioneer theme, featuring seven magnificent Old West characters.</p>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties.png" alt="Graphics featuring seven magnificent Old West characters"><figcaption class="op-vertical-bottom">View this animated SVG on my website. (Large preview)</figcaption></figure>
<p><code>&lt;symbol&gt;</code> and <code>&lt;use&gt;</code> let me define a character design and reuse it across multiple SVGs and pages. First, I created my characters and put each into a <code>&lt;symbol&gt;</code> inside a hidden library SVG:</p>
<div class="break-out">
<pre><code class="language-svg">&lt;!-- Symbols library --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" style="display:none;"&gt;
 &lt;symbol id="outlaw-1"&gt;[...]&lt;/symbol&gt;
 &lt;symbol id="outlaw-2"&gt;[...]&lt;/symbol&gt;
 &lt;symbol id="outlaw-3"&gt;[...]&lt;/symbol&gt;
 &lt;!-- etc. --&gt;
&lt;/svg&gt;
</code></pre>
</div>
<p>Then, I referenced those symbols in two other SVGs, one for large and the other for small screens:</p>
<pre><code class="language-svg">&lt;!-- Large screens --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" id="svg-large"&gt;
 &lt;use href="outlaw-1" /&gt;
 &lt;!-- ... --&gt;
&lt;/svg&gt;

&lt;!-- Small screens --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" id="svg-small"&gt;
 &lt;use href="outlaw-1" /&gt;
 &lt;!-- ... --&gt;
&lt;/svg&gt;
</code></pre>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/rose-gold-design/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Rose gold design</span></a></div><p>Elegant. But then came the infuriating. I could reuse the characters, but couldn&rsquo;t animate or style them. I added CSS rules targeting elements within the symbols referenced by a <code>&lt;use&gt;</code>, but nothing happened. Colours stayed the same, and things that should move stayed static. It felt like I&rsquo;d run into an invisible barrier, and I had.</p>
<div data-audience="non-subscriber" data-remove="true" class="feature-panel-container"><img decoding="async" loading="lazy" class="feature-panel-image-img" src="https://www.smashingmagazine.com/images/smashing-cat/cat-scubadiving-panel.svg" alt="Feature Panel" width="257" height="355"></div>


<h2 id="understanding-the-shadow-dom-barrier">Understanding The Shadow DOM Barrier</h2>
<p>When you reference the contents of a <code>symbol</code> with <code>use</code>, a browser creates a copy of it in the Shadow DOM. Each <code>&lt;use&gt;</code> instance becomes its own encapsulated copy of the referenced <code>&lt;symbol&gt;</code>, meaning that CSS from outside can&rsquo;t break through the barrier to style any elements directly. For example, in normal circumstances, this <code>tapping</code> value triggers a CSS animation:</p>
<pre><code class="language-svg">&lt;g class="outlaw-1-foot tapping"&gt;
 &lt;!-- ... --&gt;
&lt;/g&gt;
</code></pre>
<pre><code class="language-css">.tapping {
  animation: tapping 1s ease-in-out infinite;
}
</code></pre>
<p>But when the same animation is applied to a <code>&lt;use&gt;</code> instance of that same foot, nothing happens:</p>
<pre><code class="language-svg">&lt;symbol id="outlaw-1"&gt;
 &lt;g class="outlaw-1-foot"&gt;&lt;!-- ... --&gt;&lt;/g&gt;
&lt;/symbol&gt;

&lt;use href="#outlaw-1" class="tapping" /&gt;
</code></pre>
<pre><code class="language-css">.tapping {
  animation: tapping 1s ease-in-out infinite;
}
</code></pre>
<p>That&rsquo;s because the <code>&lt;g&gt;</code> inside the <code>&lt;symbol&gt;</code> element is in a protected shadow tree, and the CSS Cascade stops dead at the <code>&lt;use&gt;</code> boundary. This behaviour can be frustrating, but it&rsquo;s intentional as it ensures that reused symbol content stays consistent and predictable.</p>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/passion-work/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Passion &amp; work</span></a></div><p>While learning how to develop adaptive SVGs, I found all kinds of attempts to work around this behaviour, but most of them sacrificed the reusability that makes SVG so elegant. I didn&rsquo;t want to duplicate my characters just to make them blink at different times. I wanted a single <code>&lt;symbol&gt;</code> with instances that have their own timings and expressions.</p>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="450" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-1.png" alt="Several animated elements within a single SVG symbol"><figcaption class="op-vertical-bottom">Several animated elements within a single SVG symbol. (Large preview)</figcaption></figure>
<h2 id="css-custom-properties-to-the-rescue">CSS Custom Properties To The Rescue</h2>
<p>While working on my pioneer animations, I learned that <strong>regular CSS values can&rsquo;t cross the boundary into the Shadow DOM, but CSS Custom Properties can</strong>. And even though you can&rsquo;t directly style elements inside a <code>&lt;symbol&gt;</code>, you can pass custom property values to them. So, when you insert custom properties into an inline style, a browser looks at the cascade, and those styles become available to elements inside the <code>&lt;symbol&gt;</code> being referenced.</p>
<p>I added <code>rotate</code> to an inline style applied to the <code>&lt;symbol&gt;</code> content:</p>
<pre><code class="language-svg">&lt;symbol id="outlaw-1"&gt;
  &lt;g class="outlaw-1-foot" style="
    transform-origin: bottom right; 
    transform-box: fill-box; 
    transform: rotate(var(--foot-rotate));"&gt;
    &lt;!-- ... --&gt;
  &lt;/g&gt;
&lt;/symbol&gt;
</code></pre>
<p>Then, defined the foot tapping animation and applied it to the element:</p>
<pre><code class="language-css">@keyframes tapping {
  0%, 60%, 100% { --foot-rotate: 0deg; }
  20% { --foot-rotate: -5deg; }
  40% { --foot-rotate: 2deg; }
}

use[data-outlaw="1"] {
  --foot-rotate: 0deg;
  animation: tapping 1s ease-in-out infinite;
}
</code></pre>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/the-joy-of-art/" class="template-2"><span class="cta">Read more</span><span class="postTitle">The joy of art</span></a></div><p>Once I&rsquo;ve set up a symbol to use CSS Custom Properties, I can pass as many values as I want to any <code>&lt;use&gt;</code> instance. For example, I might define variables for <code>fill</code>, <code>opacity</code>, or <code>transform</code>. What&rsquo;s elegant is that each <code>&lt;symbol&gt;</code> instance can then have its own set of values.</p>
<pre><code class="language-svg">&lt;g class="eyelids" style="
  fill: var(--eyelids-colour, #f7bea1);
  opacity: var(--eyelids-opacity, 1);
  transform: var(--eyelids-scale, 0);"
&gt;
  &lt;!-- etc. --&gt;
&lt;/g&gt;
</code></pre>
<pre><code class="language-css">use[data-outlaw="1"] {
  --eyelids-colour: #f7bea1; 
  --eyelids-opacity: 1;
}

use[data-outlaw="2"] {
  --eyelids-colour: #ba7e5e; 
  --eyelids-opacity: 0;
}
</code></pre>
<p>Support for passing CSS Custom Properties like this is solid, and every contemporary browser handles this behaviour correctly. Let me show you a few ways I&rsquo;ve been using this technique, starting with a multi-coloured icon system.</p>
<p>When I need to maintain a set of icons, I can define an icon once inside a <code>&lt;symbol&gt;</code> and then use custom properties to apply colours and effects. Instead of needing to duplicate SVGs for every theme, each <code>use</code> can carry its own values.</p>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="167" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-2.png" alt="Custom properties for the fill colours in several Bluesky icons"><figcaption class="op-vertical-bottom">Custom properties for the fill colours in several Bluesky icons. (Large preview)</figcaption></figure>
<p>For example, I applied an <code>--icon-fill</code> custom property for the default <code>fill</code> colour of the <code>&lt;path&gt;</code> in this Bluesky icon :</p>
<pre><code class="language-svg">&lt;symbol id="icon-bluesky"&gt;
  &lt;path fill="var(--icon-fill, currentColor)" d="..." /&gt;
&lt;/symbol&gt;
</code></pre>
<p>Then, whenever I need to vary how that icon looks &mdash; for example, in a <code>&lt;header&gt;</code> and <code>&lt;footer&gt;</code> &mdash; I can pass new <code>fill</code> colour values to each instance:</p>
<pre><code class="language-html">&lt;header&gt;
  &lt;svg xmlns="http://www.w3.org/2000/svg"&gt;
    &lt;use href="#icon-bluesky" style="--icon-fill: #2d373b;" /&gt;
  &lt;/svg&gt;
&lt;/header&gt;

&lt;footer&gt;
  &lt;svg xmlns="http://www.w3.org/2000/svg"&gt;
    &lt;use href="#icon-bluesky" style="--icon-fill: #590d1a;" /&gt;
  &lt;/svg&gt;
&lt;/footer&gt;
</code></pre>
<p>These icons are the same shape but look different thanks to their inline styles.</p>
<h2 id="data-visualisations-with-css-custom-properties">Data Visualisations With CSS Custom Properties</h2>
<p>We can use <code>&lt;symbol&gt;</code> and <code>&lt;use&gt;</code> in plenty more practical ways. They&rsquo;re also helpful for creating lightweight data visualisations, so imagine an infographic about three famous Wild West sheriffs: Wyatt Earp, Pat Garrett, and Bat Masterson.</p>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="421" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-3.png" alt="Data visualisations with CSS Custom Properties"><figcaption class="op-vertical-bottom">Data visualisations with CSS Custom Properties. (Large preview)</figcaption></figure>
<p>Each sheriff&rsquo;s profile uses the same set of SVG three symbols: one for a bar representing the length of a sheriff&rsquo;s career, another to represent the number of arrests made, and one more for the number of kills. Passing custom property values to each <code>&lt;use&gt;</code> instance can vary the bar lengths, arrests scale, and kills colour without duplicating SVGs. I first created symbols for those items:</p>
<pre><code class="language-svg">&lt;svg xmlns="http://www.w3.org/2000/svg" style="display:none;"&gt;
  &lt;symbol id="career-bar"&gt;
    &lt;rect
      height="10"
      width="var(--career-length, 100)" 
      fill="var(--career-colour, #f7bea1)"
    /&gt;
  &lt;/symbol&gt;
  
  &lt;symbol id="arrests-badge"&gt;
    &lt;path 
      fill="var(--arrest-color, #d0985f)" 
      transform="scale(var(--arrest-scale, 1))"
    /&gt;
  &lt;/symbol&gt;
  
  &lt;symbol id="kills-icon"&gt;
    &lt;path fill="var(--kill-colour, #769099)" /&gt;
  &lt;/symbol&gt;
&lt;/svg&gt;
</code></pre>
<p>Each symbol accepts one or more values:</p>
<ul>
<li><strong><code>--career-length</code></strong> adjusts the <code>width</code> of the career bar.</li>
<li><strong><code>--career-colour</code></strong> changes the <code>fill</code> colour of that bar.</li>
<li><strong><code>--arrest-scale</code></strong> controls the arrest badge size.</li>
<li><strong><code>--kill-colour</code></strong> defines the <code>fill</code> colour of the kill icon.</li>
</ul>
<p>I can use these to develop a profile of each sheriff using <code>&lt;use&gt;</code> elements with different inline styles, starting with Wyatt Earp.</p>
<div class="break-out">
<pre><code class="language-svg">&lt;svg xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;g id="wyatt-earp"&gt;
    &lt;use href="#career-bar" style="--career-length: 400; --career-color: #769099;"/&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;!-- ... --&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 1;" /&gt;
    &lt;use href="#kills-icon" style="--kill-color: #769099;" /&gt;
  &lt;/g&gt;

  &lt;g id="pat-garrett"&gt;
    &lt;use href="#career-bar" style="--career-length: 300; --career-color: #f7bea1;"/&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;!-- ... --&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 1;" /&gt;
    &lt;use href="#kills-icon" style="--kill-color: #f7bea1;" /&gt;
  &lt;/g&gt;

  &lt;g id="bat-masterson"&gt;
    &lt;use href="#career-bar" style="--career-length: 200; --career-color: #c2d1d6;"/&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;!-- ... --&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 2;" /&gt;
    &lt;use href="#arrests-badge" style="--arrest-scale: 1;" /&gt;
    &lt;use href="#kills-icon" style="--kill-color: #c2d1d6;" /&gt;
  &lt;/g&gt;
&lt;/svg&gt;
</code></pre>
</div>
<p>Each <code>&lt;use&gt;</code> shares the same symbol elements, but the inline variables change their colours and sizes. I can even animate those values to highlight their differences:</p>
<pre><code class="language-css">@keyframes pulse {
  0%, 100% { --arrest-scale: 1; }
  50% { --arrest-scale: 1.2; }
}

use[href="#arrests-badge"]:hover {
  animation: pulse 1s ease-in-out infinite;
}
</code></pre>
<blockquote class="pull-quote">
<p>CSS Custom Properties aren&rsquo;t only helpful for styling; they can also channel data between HTML and SVG&rsquo;s inner geometry, binding visual attributes like colour, length, and scale to semantics like arrest numbers, career length, and kills.</p>
</blockquote>
<h2 id="ambient-animations">Ambient Animations</h2>
<p>I started learning to animate elements within symbols while creating the animated graphics for my website&rsquo;s Magnificent 7. To reduce complexity and make my code lighter and more maintainable, I needed to define each character once and reuse it across SVGs:</p>
<div class="break-out">
<pre><code class="language-svg">&lt;!-- Symbols library --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" style="display:none;"&gt;
  &lt;symbol id="outlaw-1"&gt;[&hellip;]&lt;/symbol&gt;
  &lt;!-- ... --&gt;
&lt;/svg&gt;

&lt;!-- Large screens --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" id="svg-large"&gt;
  &lt;use href="outlaw-1" /&gt;
  &lt;!-- ... --&gt;
&lt;/svg&gt;

&lt;!-- Small screens --&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" id="svg-small"&gt;
  &lt;use href="outlaw-1" /&gt;
  &lt;!-- ... --&gt;
&lt;/svg&gt;
</code></pre>
</div>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="450" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-4.png" alt="My website&rsquo;s Magnificent 7 characters"><figcaption class="op-vertical-bottom">My website&rsquo;s Magnificent 7 characters. (Large preview)</figcaption></figure>
<p>But I didn&rsquo;t want those characters to stay static; I needed subtle movements that would bring them to life. I wanted their eyes to blink, their feet to tap, and their moustache whiskers to twitch. So, to animate these details, I pass animation data to elements inside those symbols using CSS Custom Properties, starting with the blinking.</p>
<p>I implemented the blinking effect by placing an SVG group over the outlaws&rsquo; eyes and then changing its <code>opacity</code>.</p>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="333" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-5.png" alt="Blinking effect by animating eyelids&rsquo; opacity."><figcaption class="op-vertical-bottom">Blinking effect by animating eyelids&rsquo; opacity. (Large preview)</figcaption></figure>
<p>To make this possible, I added an inline style with a CSS Custom Property to the group:</p>
<div class="break-out">
<pre><code class="language-svg">&lt;symbol id="outlaw-1" viewBox="0 0 712 2552"&gt;
 &lt;g class="eyelids" style="opacity: var(--eyelids-opacity, 1);"&gt;
    &lt;!-- ... --&gt;
  &lt;/g&gt;
&lt;/symbol&gt;
</code></pre>
</div>
<p>Then, I defined the blinking animation by changing <code>--eyelids-opacity</code>:</p>
<pre><code class="language-css">@keyframes blink {
  0%, 92% { --eyelids-opacity: 0; }
  93%, 94% { --eyelids-opacity: 1; }
  95%, 97% { --eyelids-opacity: 0.1; }
  98%, 100% { --eyelids-opacity: 0; }
}
</code></pre>
<p>&hellip;and applied it to every character:</p>
<div class="break-out">
<pre><code class="language-css">use[data-outlaw] {
  --blink-duration: 4s;
  --eyelids-opacity: 1;
  animation: blink var(--blink-duration) infinite var(--blink-delay);
}
</code></pre>
</div>
<p>&hellip;so that each character wouldn&rsquo;t blink at the same time, I set a different <code>--blink-delay</code> before they all start blinking, by passing another Custom Property:</p>
<pre><code class="language-css">use[data-outlaw="1"] { --blink-delay: 1s; }
use[data-outlaw="2"] { --blink-delay: 2s; }

use[data-outlaw="7"] { --blink-delay: 3s; }
</code></pre>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-6.png" alt="Foot tapping effect by animating the foot&rsquo;s rotation"><figcaption class="op-vertical-bottom">Foot tapping effect by animating the foot&rsquo;s rotation. (Large preview)</figcaption></figure>
<p>Some of the characters tap their feet, so I added an inline style with a CSS Custom Property to those groups, too:</p>
<pre><code class="language-svg">&lt;symbol id="outlaw-1" viewBox="0 0 712 2552"&gt;
  &lt;g class="outlaw-1-foot" style="
    transform-origin: bottom right; 
    transform-box: fill-box; 
    transform: rotate(var(--foot-rotate));"&gt;
  &lt;/g&gt;
&lt;/symbol&gt;
</code></pre>
<p>Defining the foot-tapping animation:</p>
<pre><code class="language-css">@keyframes tapping {
  0%, 60%, 100% { --foot-rotate: 0deg; }
  20% { --foot-rotate: -5deg; }
  40% { --foot-rotate: 2deg; }
}
</code></pre>
<p>And adding those extra Custom Properties to the characters&rsquo; declaration:</p>
<pre><code class="language-css">use[data-outlaw] {
  --blink-duration: 4s;
  --eyelids-opacity: 1;
  --foot-rotate: 0deg;
  animation: 
    blink var(--blink-duration) infinite var(--blink-delay),
    tapping 1s ease-in-out infinite;
}
</code></pre>
<figure class="break-out article__image"><img decoding="async" loading="lazy" width="800" height="333" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-7.png" alt="Jiggling effect by animating the moustaches&rsquo; translation"><figcaption class="op-vertical-bottom">Jiggling effect by animating the moustaches&rsquo; translation. (Large preview)</figcaption></figure>
<p>&hellip;before finally making the character&rsquo;s whiskers jiggle via an inline style with a CSS Custom Property which describes how his moustache transforms:</p>
<pre><code class="language-svg">&lt;symbol id="outlaw-1" viewBox="0 0 712 2552"&gt;
  &lt;g class="outlaw-1-tashe" style="
    transform: translateX(var(--jiggle-x, 0px));"
  &gt;
    &lt;!-- ... --&gt;
  &lt;/g&gt;
&lt;/symbol&gt;
</code></pre>
<p>Defining the jiggle animation:</p>
<pre><code class="language-css">@keyframes jiggle {
  0%, 100% { --jiggle-x: 0px; }
  20% { --jiggle-x: -3px; }
  40% { --jiggle-x: 2px; }
  60% { --jiggle-x: -1px; }
  80% { --jiggle-x: 4px; }
}
</code></pre>
<p>And adding those properties to the characters&rsquo; declaration:</p>
<pre><code class="language-css">use[data-outlaw] {
  --blink-duration: 4s;
  --eyelids-opacity: 1;
  --foot-rotate: 0deg;
  --jiggle-x: 0px;
  animation: 
    blink var(--blink-duration) infinite var(--blink-delay),
    jiggle 1s ease-in-out infinite,
    tapping 1s ease-in-out infinite;
}
</code></pre>
<p>With these moving parts, the characters come to life, but my markup remains remarkably lean. By combining several animations into a single declaration, I can choreograph their movements without adding more elements to my SVG. Every outlaw shares the same base <code>&lt;symbol&gt;</code>, and their individuality comes entirely from CSS Custom Properties.</p>
<h2 id="pitfalls-and-solutions">Pitfalls And Solutions</h2>
<p>Even though this technique might seem bulletproof, there are a few traps it&rsquo;s best to avoid:</p>
<ul>
<li><strong>CSS Custom Properties only work if they&rsquo;re referenced with a <code>var()</code> inside a <code>&lt;symbol&gt;</code>.</strong> Forget that, and you&rsquo;ll wonder why nothing updates. Also, properties that aren&rsquo;t naturally inherited, like <code>fill</code> or <code>transform</code>, need to use <code>var()</code> in their value to benefit from the cascade.</li>
<li><strong>It&rsquo;s always best to include a fallback value alongside a custom property</strong>, like <code>opacity: var(--eyelids-opacity, 1);</code> to ensure SVG elements render correctly even without custom property values applied.</li>
<li><strong>Inline styles set via the <code>style</code> attribute take precedence</strong>, so if you mix inline and external CSS, remember that Custom Properties follow normal cascade rules.</li>
<li><strong>You can always use DevTools to inspect custom property values.</strong> Select a <code>&lt;use&gt;</code> instance and check the Computed Styles panel to see which custom properties are active.</li>
</ul>
<h2 id="conclusion">Conclusion</h2>
<p>The <code>&lt;symbol&gt;</code> and <code>&lt;use&gt;</code> elements are among the most elegant but sometimes frustrating aspects of SVG. The Shadow DOM barrier makes animating them trickier, but <strong>CSS Custom Properties act as a bridge</strong>. They let you pass colour, motion, and personality across that invisible boundary, resulting in cleaner, lighter, and, best of all, fun animations.</p>
<div class="signature"><img decoding="async" src="https://thenokiablog.com/wp-content/uploads/2025/11/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties-8.png" alt="Smashing Editorial" width="35" height="46" loading="lazy"><br>
<span>(gg, yk)</span></div>
<p>The post <a href="https://thenokiablog.com/smashing-animations-part-6-magnificent-svgs-with-and-css-custom-properties/">Smashing Animations Part 6: Magnificent SVGs With &#8220; And CSS Custom Properties</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>8 Autumn-Inspired CSS &#038; JavaScript Effects</title>
		<link>https://thenokiablog.com/8-autumn-inspired-css-javascript-effects/</link>
		
		<dc:creator><![CDATA[Mister Nokia]]></dc:creator>
		<pubDate>Mon, 08 Sep 2025 13:14:36 +0000</pubDate>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Animation]]></category>
		<category><![CDATA[CSS Snippets]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript Snippets]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://thenokiablog.com/8-autumn-inspired-css-javascript-effects/</guid>

					<description><![CDATA[<p>Every season has a distinct vibe. People celebrate them by wearing seasonal colors and delighting in...</p>
<p>The post <a href="https://thenokiablog.com/8-autumn-inspired-css-javascript-effects/">8 Autumn-Inspired CSS &amp; JavaScript Effects</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img decoding="async" src="https://thenokiablog.com/wp-content/uploads/2025/09/8-autumn-inspired-css-javascript-effects.jpg" class="ff-og-image-inserted"></div>
<p>Every season has a distinct vibe. People celebrate them by wearing seasonal colors and delighting in traditional flavors. Autumn appears to have taken over as a favorite time of year for many. Pumpkin spice, anyone?</p>
<p>Yes, the fall season is being celebrated like never before &ndash; and for good reason. It&rsquo;s when we embrace cooler weather, colorful leaves, and ugly sweaters. We&rsquo;re also preparing for the upcoming holidays.</p>
<p>Naturally, web developers want to get in on the fun. They&rsquo;re creating homages to the season that also show off their skills. They combine the latest in CSS and JavaScript with fun snapshots of fall life.</p>
<p>It all convinced us to collect some of the best autumn-inspired effects for your enjoyment. Their creativity will keep you cozier than a blanket and a warm cup of cider.</p>
<h2><span id="Virtual_Autumn_Corn_Maze">Virtual Autumn Corn Maze</span></h2>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/rose-gold-design/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Rose gold design</span></a></div><p class="title-details">Created by Kit Jenson</p>
<p>Nothing screams &ldquo;autumn&rdquo; like getting lost in a corn maze. This virtual maze challenges you to guide your pumpkin to safety. The game has a fun retro look and is powered by JavaScript. It&rsquo;s also a more comfortable experience for those of us who are claustrophobic.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="XWEGePe" data-pen-title="Autumn Corn Maze" data-preview="true" data-user="kitjenson"><span>See the Pen Autumn Corn Maze by Kit Jenson (@kitjenson)<br>on CodePen.</span></p>
<h2><span id="Autumn_Leaf_Fall_Preloader">Autumn Leaf Fall Preloader</span></h2>
<p class="title-details">Created by Nicolas</p>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/passion-work/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Passion &amp; work</span></a></div><p>This snippet is proof that loading graphics don&rsquo;t have to be boring. You can add seasonal flavor like this leaf animation. Watch as CSS animation spirals leaves into a virtual black hole.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="avNrEO" data-pen-title="autumn leaf fall preloader" data-preview="true" data-user="Terramaster"><span>See the Pen autumn leaf fall preloader by Nicola</span></p>
<h2><span id="Hexagonal_Autumn_Leaves_Animation">Hexagonal Autumn Leaves Animation</span></h2>
<p class="title-details">Created by Philip Warkentien II</p>
<p>How about something a bit more abstract? This mesmerizing presentation uses SVG hexagon shapes to represent leaves. The fall color scheme is beautiful. And it&rsquo;s hard to take your eyes off the sparkly animation.</p>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/the-joy-of-art/" class="template-2"><span class="cta">Read more</span><span class="postTitle">The joy of art</span></a></div><p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="ZEQOoyE" data-pen-title="Autumn Leaves" data-preview="true" data-user="warkentien2"> <span>See the Pen  Autumn Leaves by Philip Warkentien II</span></p>
<h2><span id="Animated_Glowing_Spooky_Spectral_Ghost">Animated Glowing Spooky Spectral Ghost</span></h2>
<p class="title-details">Created by Filip Zrnzevic</p>
<p>We can&rsquo;t forget about Halloween! The spooky season is well-represented by this glowing ghost presentation. Move your cursor and watch as the spirit follows you. WebGL and Three.js are the forces behind the animation &ndash; not magic.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="GgpMOEq" data-pen-title="[webgl/threejs] &#10061; Spooky Spectral Ghost" data-preview="true" data-user="filipz"> <span>See the Pen [webgl/threejs] &#10061; Spooky Spectral Ghost by Filip Zrnzevic</span></p>
<h2><span id="Autumnal_Sweater_Weather">Autumnal Sweater Weather</span></h2>
<p class="title-details">Created by McCambley</p>
<p>The chilly weather is a perfect excuse to dig out those old sweaters. You know, the ones with the wild patterns and scratchy fabric. Or, you might enjoy this garment built with CSS. The light-up diamonds are a nice touch.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="GRroGGg" data-pen-title="Sweater Weather" data-preview="true" data-user="mccambley"><span>See the Pen Sweater Weather by McCambley</span></p>
<h2><span id="Single_Div_CSS_Pumpkin_Spice_Latte">Single Div CSS Pumpkin Spice Latte</span></h2>
<p class="title-details">Created by Greg Robleto</p>
<p>Pumpkin spice has become a phenomenon. Coffee shops pump out lattes before the first leaf hits the ground &ndash; and people can&rsquo;t get enough. The flavor of the season is recreated here with a single <code>DIV</code> element. CSS gradients are used to create the various shading effects.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="BavPqPL" data-pen-title=" Pumpkin Spice Latte - Single Div CSS Art (Divtober 2023 :Day 1 :Fall)" data-preview="true" data-user="robleto"> <span>See the Pen Pumpkin Spice Latte &ndash; Single Div CSS Art (Divtober 2023 :Day 1 :Fall) by Greg Robleto</span></p>
<h2><span id="Falling_Autumn_Leaves_Shader">Falling Autumn Leaves Shader</span></h2>
<p class="title-details">Created by CeramicSoda</p>
<p>Raking leaves is perhaps the least popular autumn ritual. Watching them fall, on the other hand, is great fun. Here, you can shake a virtual tree and make the yellow-and-orange foliage fly. The best part? No cleanup!</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="xxQJqVv" data-pen-title=" Falling autumn leaves shader " data-preview="true" data-user="ceramicSoda"> <span>See the Pen Falling autumn leaves shader  by CeramicSoda</span></p>
<h2><span id="Snickers_Bar_Pure_CSS">Snickers Bar Pure CSS</span></h2>
<p class="title-details">Created by Zerde Turdybek</p>
<p>Technically, you can eat a Snickers bar any time of the year. But there&rsquo;s something special about receiving one when trick-or-treating. You can almost smell the chocolate and peanuts emanating from this CSS-rendered candy bar.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="jEPEKow" data-pen-title="Snickers" data-preview="true" data-user="3epge"> <span>See the Pen Snickers by Zerde Turdybek</span></p>
<h2><span id="The_Colors_Flavors_and_Code_of_Fall">The Colors, Flavors, and Code of Fall</span></h2>
<p>Web developers are always looking for a reason to build something fun. The colors and flavors of fall offer plenty of inspiration. The snippets above allow us to explore the season and sharpen our skills.</p>
<p>We hope you enjoyed this fresh harvest of autumn-themed code in all its glory! Please check out our CodePen collection for even more examples.</p>
<hr>
<p>here. He recently started a writing service for WordPress products: WP Product Writeup.  He also has an opinion on just about every subject. You can follow his rants on Bluesky @karks.com.</p>
<p>
                        Read more articles by Eric Karkovack
                    </p>

<hr>
<p>The post <a href="https://thenokiablog.com/8-autumn-inspired-css-javascript-effects/">8 Autumn-Inspired CSS &amp; JavaScript Effects</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>8 Comic-Inspired Snippets Powered by CSS &#038; JavaScript</title>
		<link>https://thenokiablog.com/8-comic-inspired-snippets-powered-by-css-javascript/</link>
		
		<dc:creator><![CDATA[Mister Nokia]]></dc:creator>
		<pubDate>Sun, 13 Apr 2025 16:54:13 +0000</pubDate>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Cartoon Design]]></category>
		<category><![CDATA[Comic Book Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Animation]]></category>
		<category><![CDATA[CSS Snippets]]></category>
		<category><![CDATA[Digital Art]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript Snippets]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">https://thenokiablog.com/8-comic-inspired-snippets-powered-by-css-javascript/</guid>

					<description><![CDATA[<p>Comics have served as an inspiration to many of us. They impact every corner of our...</p>
<p>The post <a href="https://thenokiablog.com/8-comic-inspired-snippets-powered-by-css-javascript/">8 Comic-Inspired Snippets Powered by CSS &amp; JavaScript</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Comics have served as an inspiration to many of us. They impact every corner of our culture. Just try going to the movies without at least one comic-based film showing. It seems nearly impossible.</p>
<p>Their style has also crept into web design. We see it in bold colors, outrageous typography, and unique layouts.</p>
<p>Advancements in both CSS and JavaScript allow designers to bring these styles to life. There is no shortage of ways to add comic-inspired flair to your website.</p>
<p>So, how are web designers bringing comic styles online? Let&rsquo;s check out a few examples of what a combination of code and creativity can do.</p>
<hr class="aside-bar">
<img fetchpriority="high" decoding="async" src="https://thenokiablog.com/wp-content/uploads/2025/04/8-comic-inspired-snippets-powered-by-css-javascript.jpg" width="870" height="223" alt="Envato Elements Unlimited Creative Assets, All In One pLace">
<h2><span id="Comic_Style_Text_Bubbles_-_CSS">Comic Style Text Bubbles &ndash; CSS</span></h2>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/rose-gold-design/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Rose gold design</span></a></div><p class="title-details">Created by Josetxu</p>
<p>This snippet demonstrates a classic comic book style. Large, bold text screams on top of colorful backgrounds. CSS Grid is used to line up the various layout pieces. Bonus: click on a word to edit the text. Wow! That was cool.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="eYoKONP" data-preview="true" data-user="josetxu">See the Pen Comic Style Text Bubbles &ndash; CSS by Josetxu</p>
<h2><span id="Side_Scroller_Comic_Web_Template">Side Scroller Comic Web Template</span></h2>
<p class="title-details">Created by Terry Scrimsher</p>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/passion-work/" class="template-2"><span class="cta">Read more</span><span class="postTitle">Passion &amp; work</span></a></div><p>Here&rsquo;s an example that adds movement to the mix. The side-scrolling hero area makes for an attention-grabbing experience. The animated text provides contrast and an element of fun.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="eBgZWR" data-preview="true" data-user="terryscrimsher">See the Pen Side Scroller Web Template by Terry Scrimsher</p>
<h2><span id="Comic_Book_Style_CSS_UI">Comic Book Style CSS UI</span></h2>
<p class="title-details">Created by Gabriele Corti</p>
<p>This experiment ponders a comic book UI. It&rsquo;s a small starting point inspired by Spider-Man. However, imagine expanding it to cover every element of a website. That&rsquo;s a way to stand out from the mere mortals.</p>
<div class="internal-linking-related-contents"><a href="https://thenokiablog.com/the-joy-of-art/" class="template-2"><span class="cta">Read more</span><span class="postTitle">The joy of art</span></a></div><p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="GeXMgm" data-preview="true" data-user="borntofrappe">See the Pen Comic Book UI by Gabriele Corti</p>
<h2><span id="Style_Stage_Comic_Book_CSS">Style Stage Comic Book CSS</span></h2>
<p class="title-details">Created by Katherine Kato</p>
<p>Let&rsquo;s go a step further with a comic-inspired UI. This page manages to balance bold styling and legibility. The layout is fun but remains super clean. It shows that &ldquo;comic&rdquo; doesn&rsquo;t have to mean inaccessible.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="wvgNVeJ" data-preview="true" data-user="kathykato">See the Pen Style Stage &ndash; Comic by Katherine Kato</p>
<h2><span id="Pure_CSS_Comic_Coder_Cat">Pure CSS Comic Coder Cat</span></h2>
<p class="title-details">Created by Annie Bombanie</p>
<p>This humorous bit pokes fun at developers. It also shows some impressive use of CSS. The black-and-white comic takes advantage of clip paths, gradients, and flexbox. The strip is also responsive.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="QWNLjKB" data-preview="true" data-user="anniebombanie">See the Pen Comic Coder Cat &ndash; Pure CSS by Annie</p>
<h2><span id="Generate_Comic-Style_Typography">Generate Comic-Style Typography</span></h2>
<p class="title-details">Created by Antoinette Janus</p>
<p>Use this snippet to generate comic-style text. Click into the box and then start typing. You&rsquo;ll get a classic comic book font on top of a halftone background.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="GRKVZOE" data-preview="true" data-user="internette">See the Pen Comic Types by Antoinette Janus</p>
<h2><span id="Responsive_Accessible_Comic_Page">Responsive &amp; Accessible Comic Page</span></h2>
<p class="title-details">Created by Sarah Frisk</p>
<p>It can be a challenge to make an accessible comic strip. The fonts aren&rsquo;t always legible. And what if you&rsquo;re using images? This snippet aims to fix these issues. It offers a &ldquo;CC&rdquo; mode that provides text descriptions of each panel. The result is an improved user experience.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="XWdLWZY" data-preview="true" data-user="sfrisk">See the Pen Responsive and Accessible Comic Page by Sarah Frisk</p>
<h2><span id="Comic_Style_Crystal_Field">Comic Style Crystal Field</span></h2>
<p class="title-details">Created by Tibix</p>
<p>It&rsquo;s easy to admire the groundbreaking illustrations in our favorite comics. This example combines beautiful artwork with the power of code. Click on the presentation to regenerate a new version of this crystal field.</p>
<p class="codepen" data-height="550" data-default-tab="result" data-slug-hash="REEJpK" data-preview="true" data-user="Tibixx">See the Pen Comic Style Crystal Field by Tibix</p>
<h2><span id="Adding_Some_Pop_to_the_Web">Adding Some Pop to the Web</span></h2>
<p>Not every website requires a staid corporate look. Comic styles offer an alternative for these sites. You can use this technique to create a fun and memorable UX.</p>
<p>What&rsquo;s more, you don&rsquo;t have to go over the top to find success. Even subtle elements of comic design can make a positive impact. Look no further than some of the examples above for proof.</p>
<p>Want to see even more examples of comic styles? Use your superpowers and head on over to our CodePen collection!</p>
<div class="topics">
<h2>Related Topics</h2>
</div>
<p><i class="fa fa-arrow-up"></i><br>Top</p>
<p>The post <a href="https://thenokiablog.com/8-comic-inspired-snippets-powered-by-css-javascript/">8 Comic-Inspired Snippets Powered by CSS &amp; JavaScript</a> appeared first on <a href="https://thenokiablog.com">The NOKIA Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
