On this page
- 1. The Design Brief—and the Early Choice We Reconsidered
- 2. Four Engineering Decisions That Keep the Deck Accessible
- 3. Reusable Starter Pattern (HTML, CSS & Vanilla JS)
- 4. What We Verified in This Version—and What to Retest When You Adapt It
- Bring Epicpaths into your next component build or agency project
Welcome to the launch edition of Epicpaths Showcase—a new sub-series inside Epicpaths Playbooks built around a simple premise: aligning with WCAG 2.2 Level AA does not mean stripping personality, depth, or motion out of your interface.
If you haven’t tried the live component above yet, click or tab into the six topic buttons at the top of this page, move across them with your Left and Right Arrow keys, and toggle Simulate Reduced Motion and ARIA & Crop X-Ray. Everything below walks through why we redesigned this component for The Impact: Who and Why, what we rejected along the way, the reusable code you can adapt for your own site, and the exact checks you should re-run after styling it.
1. The Design Brief—and the Early Choice We Reconsidered
When we rebuilt the body of the Impact page with six concrete, illustrated user stories—covering vision, hearing, mobility, cognitive load, flashing and motion, and speech—the original hero at the top of the page suddenly felt out of place. That earlier hero used six full-width, colour-tinted photographic banners. Readers were meeting the same six categories twice in two completely different visual languages, and the dark colour wash across each photograph muted the human focal point in the artwork.
We wanted a top showcase that gave visitors six recognisable ways into the page while keeping visual craft and depth. Before landing on the staggered deck above, we evaluated two common gallery directions—and rejected parts of both:
Why we kept tab control instead of scroll-jacking
Scroll-driven card stacks look dramatic in motion reels, but tying six topic panels to scroll position forces a keyboard or screen-magnification reader to scrub through five intermediate cards just to reach topic six—and frequently misbehaves at 200% browser zoom. Keeping the explicit six-button controller bar lets anyone jump straight to Speech & voice in one action.
Layered depth with predictable user control
Sitting the framed photograph higher on the left (with subtle stacked card backplates behind it) and overlapping the white editorial card across its lower-right margin gives the layout tactile depth—while a 5px top accent and pill colour thread visually connect each top card to the detailed story it jumps to below.
2. Four Engineering Decisions That Keep the Deck Accessible
A. W3C ARIA tablist With Roving Arrow Keys (and One Clean Tab Stop)
A common failure in custom tab sliders is wiring six buttons that all stay in the sequential Tab order—forcing a keyboard user who picks tab 01 to press Tab five extra times across tabs 02–06 before reaching the card’s call-to-action link. Following the W3C ARIA Authoring Practices Tabs pattern (opens in a new tab):
- Only the currently selected
role="tab"carriestabindex="0"andaria-selected="true"; inactive tabs carrytabindex="-1"andaria-selected="false". - Left Arrow, Right Arrow, Home, and End move focus directly across the six tabs and reveal the matching
role="tabpanel". - Pressing Tab once from whichever topic tab you chose moves keyboard focus straight onto the active card’s jump link—never through hidden panels (which carry the native
hiddenattribute). - Nothing auto-rotates, aligning cleanly with WCAG 2.2.2 (Pause, Stop, Hide) so readers using screen magnification or cognitive assistive tools never lose their place mid-sentence.
B. Native <img alt="..."> + Per-Photo Focal Framing Instead of CSS Backgrounds
When a layout crops photographs into rounded cards across desktop (16:10.5) and phone (16:10) aspect ratios, it is tempting to reach for CSS background-image and background-position. The catch is that CSS background images vanish from the accessibility tree—leaving screen-reader users with no description unless developers bolt on fragile role="img" wrappers.
Using a real HTML <img> element paired with object-fit: cover and per-image object-position gives you exact focal framing and first-class semantics. For example, on the Vision card, object-position: 46% 68% centres the hands reading the refreshable braille display while clipping distracting desk background; on Mobility, object-position: 58% 58% with a subtle scale(1.22) keeps the typist’s hands in frame across breakpoints.
C. Asymmetric CSS Grid Overlap That Unstacks Cleanly at 320 CSS px and 200% Zoom
Overlapping cards break accessibility whenever developers position the text card with position: absolute or lock the container to a fixed pixel height. At 200% text zoom (WCAG 1.4.4) or on a 320 CSS px viewport (WCAG 1.4.10 Reflow), fixed-height overlapping boxes clip sentences or spill off-screen.
Instead, both cards live inside a normal-flow 12-column CSS Grid on desktop (992px+): the photo wrapper occupies columns 1 / 8 in row 1 with margin-bottom: 3.1rem, and the white story card occupies columns 7 / 13 in the same row 1 with margin-top: 3.1rem. Column 7 creates the ~80px horizontal overlap naturally while both cards grow vertically with their text. Below 992px, the layout drops to a single flex column where the white card tucks gently (margin-top: -1.6rem) over the bottom edge of the photo without obscuring its focal subject.
D. Two-Style Focus Indicators & User-Controlled Card-Deal Motion
Because the tab controller sits on dark navy (#11253a) while the active tab button is bright cyan (#64dfdf) and the overlapping story card is crisp white (#ffffff), a single focus outline colour would fail WCAG 1.4.11 (Non-text Contrast, 3:1+) on at least one surface. Inactive dark tabs receive a high-contrast lime ring (#36f710, 10.7:1 against navy), while the active cyan tab and the card’s action button receive a two-part white inner ring and dark-navy outer halo (~17:1). When switching tabs, the subtle 0.32s card-deal keyframe entrance is automatically disabled inside @media (prefers-reduced-motion: reduce).
3. Reusable Starter Pattern (HTML, CSS & Vanilla JS)
The starter code below strips out all WordPress-specific classes so you can adapt the staggered tab deck cleanly in any CMS, static site, or component framework. All quotes are literal straight ASCII quotes.
HTML Structure
<section class="stagger-showcase" aria-label="Featured user stories">
<div class="stagger-tablist" role="tablist" aria-label="Choose a story topic">
<button type="button" id="tab-vision" role="tab" aria-selected="true"
aria-controls="panel-vision" tabindex="0" class="stagger-tab is-active">
Vision
</button>
<button type="button" id="tab-mobility" role="tab" aria-selected="false"
aria-controls="panel-mobility" tabindex="-1" class="stagger-tab">
Mobility
</button>
</div>
<div id="panel-vision" role="tabpanel" aria-labelledby="tab-vision"
class="stagger-panel stagger-panel--vision">
<div class="stagger-grid">
<div class="stagger-photo-wrap">
<div class="stagger-photo-frame">
<img src="vision-braille.jpg" width="1200" height="675"
alt="Hands reading a refreshable braille display connected to a laptop."
class="stagger-photo stagger-photo--vision" />
</div>
</div>
<div class="stagger-card">
<span class="stagger-kicker">01 • Vision</span>
<h2>Finding the policy that answers the question</h2>
<p>A screen-reader user can jump straight to "Returns and exchanges" from the headings list. A shopper who magnifies the page can read the same policy with clear contrast and without losing their place.</p>
<a href="#vision-story" class="stagger-cta">Jump to the vision story</a>
</div>
</div>
</div>
<div id="panel-mobility" role="tabpanel" aria-labelledby="tab-mobility"
class="stagger-panel stagger-panel--mobility" hidden>
<div class="stagger-grid">
<div class="stagger-photo-wrap">
<div class="stagger-photo-frame">
<img src="mobility-keyboard.jpg" width="1200" height="800"
alt="Person typing on a laptop keyboard at a desk."
class="stagger-photo stagger-photo--mobility" />
</div>
</div>
<div class="stagger-card">
<span class="stagger-kicker">02 • Mobility and dexterity</span>
<h2>Keeping your place at checkout</h2>
<p>Someone navigating by keyboard or switch control needs visible focus inside dialogs and predictable return focus afterward so choosing delivery leaves them one step from placing the order.</p>
<a href="#mobility-story" class="stagger-cta">Jump to the mobility story</a>
</div>
</div>
</div>
</section>
Core CSS Grid Overlap, Focal Crop & Reduced-Motion Rules
.stagger-panel--vision { --topic-accent: #6f242f; }
.stagger-panel--mobility { --topic-accent: #262e6c; }
.stagger-grid {
display: flex;
flex-direction: column;
}
.stagger-photo-wrap {
position: relative;
padding-top: 14px;
padding-left: 14px;
}
/* Stacked deck backplate with subtle topic accent */
.stagger-photo-wrap::after {
content: "";
position: absolute;
inset: 7px 11px 11px 7px;
border-radius: 1.25rem;
background: #f8fafc;
border: 1.5px solid var(--topic-accent, #0b1a29);
z-index: 1;
}
.stagger-photo-frame {
position: relative;
z-index: 2;
border-radius: 1.25rem;
overflow: hidden;
aspect-ratio: 16 / 10;
}
.stagger-photo {
width: 100%;
height: 100%;
object-fit: cover;
}
/* Tune per-image focal coordinates so key details stay centered */
.stagger-photo--vision { object-position: 46% 68%; }
.stagger-photo--mobility { object-position: 58% 58%; }
.stagger-card {
position: relative;
z-index: 3;
background: #ffffff;
color: #0b1a29;
border: 1.5px solid #94a3b8;
border-top: 5px solid var(--topic-accent, #0b1a29);
border-radius: 1.25rem;
padding: 1.4rem;
margin: -1.6rem 0.5rem 0 1.25rem;
}
@media (min-width: 992px) {
.stagger-grid {
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
align-items: start;
}
.stagger-photo-wrap {
grid-column: 1 / 8;
grid-row: 1;
margin-bottom: 3.1rem;
}
.stagger-card {
grid-column: 7 / 13;
grid-row: 1;
margin: 3.1rem 0 0 0;
padding: 2rem;
align-self: center;
}
}
@keyframes dealPhoto {
from { transform: translate3d(-16px, -10px, 0) scale(0.985); }
to { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes dealCard {
from { transform: translate3d(20px, 12px, 0); }
to { transform: translate3d(0, 0, 0); }
}
.stagger-panel.is-entering .stagger-photo-wrap {
animation: dealPhoto 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stagger-panel.is-entering .stagger-card {
animation: dealCard 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
.stagger-panel.is-entering .stagger-photo-wrap,
.stagger-panel.is-entering .stagger-card {
animation: none !important;
}
}
Roving ARIA Tablist JavaScript
(function () {
const root = document.querySelector('.stagger-showcase');
if (!root) return;
const tabs = Array.from(root.querySelectorAll('[role="tab"]'));
const panels = tabs.map((t) => document.getElementById(t.getAttribute('aria-controls')));
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
function selectTab(nextIndex, moveFocus) {
const idx = ((nextIndex % tabs.length) + tabs.length) % tabs.length;
tabs.forEach((tab, i) => {
const active = i === idx;
tab.classList.toggle('is-active', active);
tab.setAttribute('aria-selected', String(active));
tab.setAttribute('tabindex', active ? '0' : '-1');
if (active && moveFocus) tab.focus();
});
panels.forEach((panel, i) => {
if (!panel) return;
const active = i === idx;
panel.classList.remove('is-entering');
panel.hidden = !active;
if (active && !reduceMotion) {
void panel.offsetWidth;
panel.classList.add('is-entering');
}
});
}
tabs.forEach((tab, i) => {
tab.addEventListener('click', () => selectTab(i, false));
tab.addEventListener('keydown', (e) => {
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
e.preventDefault();
selectTab(i + 1, true);
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
e.preventDefault();
selectTab(i - 1, true);
} else if (e.key === 'Home') {
e.preventDefault();
selectTab(0, true);
} else if (e.key === 'End') {
e.preventDefault();
selectTab(tabs.length - 1, true);
}
});
});
})();
4. What We Verified in This Version—and What to Retest When You Adapt It
No standalone code snippet guarantees accessibility once dropped into a different page template. Every Epicpaths Showcase edition records the exact scope verified on the published demo and the checks your team must run after adapting it into your own codebase.
v1.2.49)1280px, 200% zoom) & mobile (390px / 320px reflow), keyboard roving focus, prefers-reduced-motion, and programmatic ARIA/contrast checksVerified on this Showcase version
- Keyboard choreography (WCAG 2.1.1 & 2.4.3): Roving
tabindexacross all sixrole="tab"buttons via Arrow, Home, and End keys; one Tab press enters the active card’s link; inactivehiddenpanels expose zero ghost tab stops. - Focus visibility & target size (WCAG 1.4.11, 2.4.7 & 2.5.8): Minimum
44pxbutton height on every topic tab and action button;10.7:1lime ring on dark navy tabs and~17:1white-and-navy double ring on active cyan and light card controls. - Zoom & mobile reflow (WCAG 1.4.4 & 1.4.10): Normal-flow CSS Grid overlap expands vertically at
200%text zoom and collapses cleanly to a single column down to320 CSS pxwith zero horizontal page scroll. - Image semantics & motion control (WCAG 1.1.1 & 2.3.3): Native
<img alt="...">descriptions paired with per-photo focal coordinates; card-deal keyframes disabled underprefers-reduced-motion: reduce.
Retest when you adapt this pattern
- Your own photography crops: Every photograph has a different subject centre. Inspect each image at
1280px,768px, and320pxso the card overlap never covers a face, hand, or caption inside the image—and write analtattribute that reflects why that photo is there. - Your brand accent colours: If you use custom topic colours for kicker text or pills, re-measure text contrast at
4.5:1+(all six accents in our demo measure7.1:1to10.1:1). - Heading level inside your page outline: In our standalone Impact page hero, each panel heading is an
<h2>; inside this article’s demo frame (which sits under an<h2>stage title), each card uses<h3>so no heading level is skipped. - Screen-reader pass in your live template: Verify in NVDA (Firefox/Chrome) and VoiceOver (Safari/iOS) that selecting a tab announces its name, selected state, and 1 of N position cleanly.