<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muneeb Ali</title>
    <description>The latest articles on DEV Community by Muneeb Ali (@cascadedev).</description>
    <link>https://dev.to/cascadedev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4222673%2F3b4ef443-037d-4f7d-9b69-569ae7328017.png</url>
      <title>DEV Community: Muneeb Ali</title>
      <link>https://dev.to/cascadedev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cascadedev"/>
    <language>en</language>
    <item>
      <title>Goodbye :nth-child! How Modern CSS sibling-index() Works Under the Hood</title>
      <dc:creator>Muneeb Ali</dc:creator>
      <pubDate>Mon, 02 Nov 2026 15:59:38 +0000</pubDate>
      <link>https://dev.to/cascadedev/goodbye-nth-child-how-modern-css-sibling-index-works-under-the-hood-28p2</link>
      <guid>https://dev.to/cascadedev/goodbye-nth-child-how-modern-css-sibling-index-works-under-the-hood-28p2</guid>
      <description>&lt;p&gt;Ever found yourself writing endless lines of &lt;code&gt;:nth-child(1)&lt;/code&gt;, &lt;code&gt;:nth-child(2)&lt;/code&gt;, &lt;code&gt;:nth-child(3)&lt;/code&gt; or injecting custom CSS variables via JavaScript just to stagger a list of entrance animations?&lt;/p&gt;

&lt;p&gt;Modern CSS (Values &amp;amp; Units Module Level 5) introduces two native functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sibling-index()&lt;/code&gt;&lt;/strong&gt; — Returns the 1-based index of the element among its siblings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sibling-count()&lt;/code&gt;&lt;/strong&gt; — Returns the total count of siblings under the parent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the complete video breakdown and live animation:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/qMdy7NDZnRk" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Staggered Delays in Pure CSS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cardFadeIn&lt;/span&gt; &lt;span class="m"&gt;0.6s&lt;/span&gt; &lt;span class="nf"&gt;cubic-bezier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;both&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sibling-index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;120ms&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Dynamic 360° Color Wheels with OKLCH
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.chip&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--hue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;sibling-index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;sibling-count&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;360deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0.68&lt;/span&gt; &lt;span class="m"&gt;0.22&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--hue&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Reverse z-Index Overlapping Avatars
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.avatar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-14px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sibling-count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;sibling-index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🎯 60-Second Challenge: Can You Solve It?
&lt;/h2&gt;

&lt;p&gt;Can you write a single &lt;code&gt;calc()&lt;/code&gt; formula so the &lt;strong&gt;middle item&lt;/strong&gt; in an odd list of bars gets the largest height/scale?&lt;/p&gt;

&lt;p&gt;Download the starter HTML file and test your formula:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📄 &lt;strong&gt;GitHub Code Vault&lt;/strong&gt;: &lt;a href="https://github.com/muneebali500/cascadedev-code-vault" rel="noopener noreferrer"&gt;github.com/muneebali500/cascadedev-code-vault&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Drop your solution in the YouTube comments or right here in the comments below!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
