Loading skeletons
Placeholder cards with a shimmer sweeping across grey shapes, the pattern used while content is loading. Use it to show that content is on its way, in place of a spinner. Replace each placeholder with the real card when it arrives.
<section class="blk-section" aria-labelledby="blk-skel-h">
<div class="blk-container">
<header class="blk-head">
<div class="blk-head__main">
<h2 id="blk-skel-h">Loading state</h2>
<p>Placeholders that hold the layout while the real content loads.</p>
</div>
</header>
<ul class="blk-skel">
<li class="blk-skel__card" aria-hidden="true">
<span class="blk-skel__img"></span>
<span class="blk-skel__line blk-skel__line--short"></span>
<span class="blk-skel__line"></span>
<span class="blk-skel__line blk-skel__line--mid"></span>
</li>
<li class="blk-skel__card" aria-hidden="true">
<span class="blk-skel__img"></span>
<span class="blk-skel__line blk-skel__line--short"></span>
<span class="blk-skel__line"></span>
<span class="blk-skel__line blk-skel__line--mid"></span>
</li>
<li class="blk-skel__card" aria-hidden="true">
<span class="blk-skel__img"></span>
<span class="blk-skel__line blk-skel__line--short"></span>
<span class="blk-skel__line"></span>
<span class="blk-skel__line blk-skel__line--mid"></span>
</li>
</ul>
</div>
</section>.blk-skel { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.blk-skel__card { display: grid; gap: 12px; padding: 16px; background: var(--blk-surface); border: 1px solid var(--blk-line); border-radius: var(--blk-radius); }
.blk-skel__img, .blk-skel__line { display: block; border-radius: 6px; background: linear-gradient(100deg, var(--blk-band-a) 30%, color-mix(in srgb, var(--blk-band-a) 40%, #fff) 50%, var(--blk-band-a) 70%); background-size: 300% 100%; animation: blk-skel-sweep 1.8s ease-in-out infinite; }
.blk-skel__img { aspect-ratio: 16 / 10; border-radius: var(--blk-radius); }
.blk-skel__line { height: 14px; }
.blk-skel__line--short { width: 40%; }
.blk-skel__line--mid { width: 70%; }
@keyframes blk-skel-sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (min-width: 720px) { .blk-skel { grid-template-columns: repeat(3, 1fr); } }How to customise it
- Match the number and shape of the placeholders to the real content so nothing jumps when it loads.
- The list is hidden from screen readers. Add a visually hidden message such as Loading articles inside the live region around it.
- Remove the shimmer by deleting the animation line if you want static placeholders.
- All motion stops when the visitor has asked their device for reduced motion, because base.css switches animations off.
Tokens it reads
--blk-band-a--blk-line--blk-surface--blk-radiusAdd the "Loading skeletons" block from Product Scope Blocks (https://resources.productscope.uk/blocks/blocks/skeleton-cards) to my page. Link https://resources.productscope.uk/blocks/blocks/kit/blocks.css once. Paste the HTML from https://resources.productscope.uk/blocks/blocks/kit/blocks/skeleton-cards.html and replace the placeholder text with my real content. Do not change the class names, add inline styles or add scripts. To change colours or fonts, override the --blk- variables in my own CSS. Do not invent facts, clients or numbers.