Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: hide Skeleton Loader's real content from screen readers while the placeholders show

matindd2b5aaba909
diff --git a/animations/04-micro-interactions/skeleton-loader/README.md b/animations/04-micro-interactions/skeleton-loader/README.md
index 665f693e..65fd163a 100644
--- a/animations/04-micro-interactions/skeleton-loader/README.md
+++ b/animations/04-micro-interactions/skeleton-loader/README.md
@@ -56,7 +56,7 @@ The content element needs `opacity: 0; transition: opacity 400ms ease` to fade i
- **Real data approximation**: if you know the content length, dynamically size the skeleton lines to match (e.g., profile names are typically 1–2 lines; descriptions are 3–4).
- **`prefers-reduced-motion`**: disable the pulse animation entirely for users who request it. A static gray block is still a valid skeleton loader.
- **React**: `react-loading-skeleton` (by Dvtng) is the standard library. It auto-matches skeleton widths to inline text nodes.
-- **Pairing**: skeleton + shimmer (see [Shimmer Effect](../shimmer-effect/)) is the most polished loading state — pulse for structure, shimmer for motion.
+- **Pulse or shimmer**: a skeleton shows loading either by pulsing, as here, or with a sweeping band of light ([Shimmer Effect](../shimmer-effect/)); pick one, since the two together are redundant and visually loud.
## See also
- [Shimmer Effect](../shimmer-effect/) — a band of light sweeps across the placeholders
diff --git a/animations/04-micro-interactions/skeleton-loader/index.html b/animations/04-micro-interactions/skeleton-loader/index.html
index a633f8f4..2b54c0a8 100644
--- a/animations/04-micro-interactions/skeleton-loader/index.html
+++ b/animations/04-micro-interactions/skeleton-loader/index.html
@@ -84,7 +84,7 @@
<div class="skel sk-line w60"></div>
</div>
<!-- Real content -->
- <div class="real" id="real-content">
+ <div class="real" id="real-content" aria-hidden="true">
<div class="real-header">
<div class="avatar">🌊</div>
<div><div class="real-name">Atlas Studio</div><div class="real-meta">2 hours ago · Design</div></div>
@@ -202,18 +202,20 @@
},wait);
timers.push(id);
}
- // Brings the placeholders back and hides the content at once: the content's fade is switched off
- // for the change, a reflow makes it stick, then the fade is switched back on for the reveal.
+ // Brings the placeholders back and hides the content at once, from screen readers too (aria-hidden): the content's
+ // fade is switched off for the change, a reflow makes it stick, then the fade is switched back on for the reveal.
function showPlaceholders(){
skelEl.style.visibility='';
realEl.style.transition='none';
realEl.classList.remove('visible');
+ realEl.setAttribute('aria-hidden','true');
void realEl.offsetWidth;
realEl.style.transition='';
}
function reveal(){
skelEl.style.visibility='hidden';
realEl.classList.add('visible');
+ realEl.removeAttribute('aria-hidden');
}
// One play shows the placeholders for Loading time, then fades the content in. While Loop is on, the content
// holds 1600ms after its fade ends; Loop is checked then, so switching it off leaves the content shown.
diff --git a/docs/superpowers/plans/2026-09-29-micro-content-part1.md b/docs/superpowers/plans/2026-09-29-micro-content-part1.md
index 329440cd..a5d62127 100644
--- a/docs/superpowers/plans/2026-09-29-micro-content-part1.md
+++ b/docs/superpowers/plans/2026-09-29-micro-content-part1.md
@@ -683,7 +683,10 @@ None: leave out the `details.hb-options` block.
- [Loading Spinner](../loading-spinner/) — a spinner for waits of unknown length
- [Progress Animation](../progress-animation/) — a bar that shows how much is done
- **README How it works:** unchanged
-- **README Production notes:** unchanged
+- **README Production notes:** unchanged, except the last bullet (final fix wave, below)
+- **Final fix wave (after the category review):**
+ - Screen readers read the real post text while the placeholders showed. `#real-content` now starts with `aria-hidden="true"`; `showPlaceholders()` sets it again on every play and `reveal()` removes it. So the text is hidden from screen readers exactly while the placeholders show (and hidden at once when Replay or Loop brings them back), and readable after the reveal. Nothing changes for sighted visitors.
+ - README Production notes: the last bullet said skeleton plus shimmer "is the most polished loading state", which contradicted Shimmer Effect's README ("pick one"). It is now "Pulse or shimmer": a skeleton shows loading either by pulsing, as here, or with a sweeping band of light (Shimmer Effect); pick one, since the two together are redundant and visually loud.
- **Category line:** `04.09 · Micro-Interactions`
- **Pager:** Previous: Success Confetti (`../success-confetti/`) · Next: Shimmer Effect (`../shimmer-effect/`)