Accessibility Issue: Heading hierarchy issue on homepage
WCAG Level: A
Severity: Medium
Category: Semantic HTML
Issue Description
The homepage (src/pages/index.tsx) starts with an <h2> heading ("Effective Shell") instead of an <h1>. This violates the heading hierarchy best practice where pages should have exactly one <h1> as the primary heading.
Similarly, the feature cards use <h3> without a preceding <h2> parent context on the page.
User Impact
- Affected Users: Screen reader users, users who navigate by headings
- Severity: Users navigating by headings may be confused by the missing
<h1> and incorrect hierarchy
Violations Found
File: src/pages/index.tsx
Lines: 12, 85
// Line 12
<h2 className={styles.heroTitle}>Effective Shell</h2>
// Line 85
<h3 className={styles.featureTitle}>{feature.title}</h3>
Issue:
- Main page title uses
<h2> instead of <h1>
- Feature cards use
<h3> without proper heading hierarchy
- The page has no
<h1> element
Recommended Fix
function HeroSection() {
return (
<header className={styles.heroBanner}>
<div className={styles.heroContent}>
<div className={styles.heroText}>
<h1 className={styles.heroTitle}>Effective Shell</h1>
...
</div>
</div>
</header>
);
}
function FeatureSection() {
return (
<section className={styles.features}>
<div className={styles.featuresContainer}>
<h2 className="visually-hidden">Key Features</h2>
<div className={styles.featureGrid}>
{features.map((feature, idx) => (
<div key={idx} className={styles.featureCard}>
<h3 className={styles.featureTitle}>{feature.title}</h3>
...
</div>
))}
</div>
</div>
</section>
);
}
Changes Made:
- Changed hero title from
<h2> to <h1>
- Added visually hidden
<h2> before feature cards for proper hierarchy
- Feature
<h3> elements now have proper parent context
CSS for visually hidden class:
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
Testing Instructions
- Use a screen reader or browser extension to list all headings on the page
- Verify there is exactly one
<h1> element
- Verify heading levels don't skip (h1 → h2 → h3)
- Test with Chrome DevTools Accessibility tree
Resources
Acceptance Criteria
Accessibility Issue: Heading hierarchy issue on homepage
WCAG Level: A
Severity: Medium
Category: Semantic HTML
Issue Description
The homepage (
src/pages/index.tsx) starts with an<h2>heading ("Effective Shell") instead of an<h1>. This violates the heading hierarchy best practice where pages should have exactly one<h1>as the primary heading.Similarly, the feature cards use
<h3>without a preceding<h2>parent context on the page.User Impact
<h1>and incorrect hierarchyViolations Found
File:
src/pages/index.tsxLines: 12, 85
Issue:
<h2>instead of<h1><h3>without proper heading hierarchy<h1>elementRecommended Fix
Changes Made:
<h2>to<h1><h2>before feature cards for proper hierarchy<h3>elements now have proper parent contextCSS for visually hidden class:
Testing Instructions
<h1>elementResources
Acceptance Criteria
<h1>element