<?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>Forem: Sandeep C Nath</title>
    <description>The latest articles on Forem by Sandeep C Nath (@sandeepcnath).</description>
    <link>https://forem.com/sandeepcnath</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1372284%2F3ad4b0f0-5eab-4954-b9c0-0afc0eb0eb3b.png</url>
      <title>Forem: Sandeep C Nath</title>
      <link>https://forem.com/sandeepcnath</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sandeepcnath"/>
    <language>en</language>
    <item>
      <title>"Heading elements are not in a sequentially-descending order."</title>
      <dc:creator>Sandeep C Nath</dc:creator>
      <pubDate>Sat, 01 Jun 2024 06:49:55 +0000</pubDate>
      <link>https://forem.com/sandeepcnath/heading-elements-are-not-in-a-sequentially-descending-order-2306</link>
      <guid>https://forem.com/sandeepcnath/heading-elements-are-not-in-a-sequentially-descending-order-2306</guid>
      <description>&lt;p&gt;This is a common a11y error that occurs and is the simplest to fix.&lt;br&gt;
This happens like when we add a &lt;code&gt;&amp;lt;h4&amp;gt;&lt;/code&gt; after a &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; skipping &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Often when we do the layout we choose elements like h1 or h2 based on the size of the text and not on the context.&lt;/p&gt;

&lt;p&gt;While declaring styles if we write,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h4, .h4 {
    some styles
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can replace the h4 with this &lt;code&gt;&amp;lt;h3 class="h4"&amp;gt;&lt;/code&gt; that looks like a h4 and avoid the error.&lt;/p&gt;

&lt;p&gt;This way we can stick to what the designer intended and keep the heading sequentially ordered.&lt;/p&gt;

&lt;p&gt;This will also help you when you have a banner text with h1 font-size but your actual title with a smaller font-size will be inside the main, in that case just add the class h1 to the banner text and use &lt;code&gt;&amp;lt;h1 class="h2"&amp;gt;&lt;/code&gt; for the heading in main.&lt;/p&gt;

&lt;p&gt;If you're using hashtag#SASS, the following snippet will eliminate need to specifically add styles for each &lt;code&gt;&amp;lt;h tag&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@for $i from 1 through 6 {
   h#{$i}, .h#{$i} {
     font: 700 var(--h#{$i}) / 1.2 var(--primary-font);
     margin: 0 0 0.5rem;
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>a11y</category>
      <category>html</category>
      <category>css</category>
    </item>
  </channel>
</rss>
