Numeral contents
The centred table of contents: numerals in a right-aligned column, titles beside them, and a picture that fades in for the row under the pointer.
Part of the style
Roman Numeral Plates
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/roman-numeral-plates/contents/figma.html?palette=7ef8064dfd89d2ff
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/roman-numeral-plates/contents/figma.html?palette=7ef8064dfd89d2ff and pass that whole HTML document to the html_to_figma tool, so the part "Numeral contents" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
:root {
--ink: #fbf4ee;
--ink-faint: #584c4c;
--paper: #251a1a;
--veil: rgba(37, 26, 26, 0.72);
--mat: #332828;
}
</style>
<section class="contents" aria-label="Contents">
<ol class="contents__list">
<li><a class="contents__row is-current" href="#"><span class="contents__numeral">I</span><span class="contents__title">Oriel Quarterly</span><span class="contents__note">gloves, spring</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">II</span><span class="contents__title">Maison Tesse <em>x</em> Fold Paper Co.</span><span class="contents__note">pattern book</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">III</span><span class="contents__title">Lumen Ceramics</span><span class="contents__note">tea things</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">IV</span><span class="contents__title">Atelier Brume</span><span class="contents__note">flowers, late</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">V</span><span class="contents__title">Kettle & Loom</span><span class="contents__note">brocade</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">VI</span><span class="contents__title">Vell Editions</span><span class="contents__note">glass, cover</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">VII</span><span class="contents__title">The Weaving Rooms</span><span class="contents__note">slippers</span></a></li>
<li><a class="contents__row" href="#"><span class="contents__numeral">VIII</span><span class="contents__title">Table Manners <em>ed.</em> 03</span><span class="contents__note">porcelain</span></a></li>
</ol>
<div class="contents__frame" aria-hidden="true">
<img class="contents__picture is-current" src="assets/gloves.jpg" alt="" width="1057" height="1200">
<img class="contents__picture" src="assets/ribbons.jpg" alt="" width="596" height="800" loading="lazy">
<img class="contents__picture" src="assets/tea-bowl.jpg" alt="" width="800" height="575" loading="lazy">
<img class="contents__picture" src="assets/magnolias.jpg" alt="" width="1200" height="737" loading="lazy">
<img class="contents__picture" src="assets/textile.jpg" alt="" width="800" height="617" loading="lazy">
<img class="contents__picture" src="assets/jar.jpg" alt="" width="797" height="800" loading="lazy">
<img class="contents__picture" src="assets/shoes.jpg" alt="" width="800" height="545" loading="lazy">
<img class="contents__picture" src="assets/bowl.jpg" alt="" width="800" height="608" loading="lazy">
</div>
</section>
<style>
.contents {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
align-items: center;
gap: var(--space-l);
padding: var(--space-xl) var(--edge);
color: var(--ink);
font: 400 var(--text)/var(--leading) var(--font-serif);
}
.contents__list {
justify-self: end;
margin: 0;
padding: 0;
list-style: none;
}
.contents__row {
display: grid;
grid-template-columns: var(--numeral-col) minmax(0, 14em) 7em;
gap: var(--space-m);
align-items: center;
min-height: 44px;
color: var(--ink-faint);
text-decoration: none;
transition: color var(--quick) var(--ease);
}
.contents__row.is-current { color: var(--ink); }
.contents__row:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.contents__numeral {
text-align: right;
font-variant: all-small-caps;
letter-spacing: 0.06em;
}
.contents__note {
font-style: italic;
opacity: 0;
transition: opacity var(--quick) var(--ease);
}
.contents__row.is-current .contents__note { opacity: 1; }
.contents__frame {
position: relative;
justify-self: start;
width: min(100%, 420px);
aspect-ratio: 4 / 5;
}
.contents__picture {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: left center;
opacity: 0;
transition: opacity var(--fade) var(--ease);
}
.contents__picture.is-current { opacity: 1; }
@media (max-width: 760px) {
.contents { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-l); }
.contents__frame { order: -1; justify-self: center; width: min(100%, 320px); }
.contents__picture { object-position: center; }
.contents__list { justify-self: center; }
.contents__row { grid-template-columns: 2.4em minmax(0, 1fr); }
.contents__note { display: none; }
}
</style>
<script>
(() => {
for (const root of document.querySelectorAll('.contents')) {
const rows = [...root.querySelectorAll('.contents__row')];
const pictures = [...root.querySelectorAll('.contents__picture')];
const show = (index) => {
rows.forEach((row, at) => row.classList.toggle('is-current', at === index));
pictures.forEach((picture, at) => picture.classList.toggle('is-current', at === index));
};
rows.forEach((row, index) => {
row.addEventListener('pointerenter', () => show(index));
row.addEventListener('focus', () => show(index));
});
}
})();
</script>