My working set of interface parts. Each one is plain HTML and CSS that reads only theme tokens, so the theme switch above restyles everything on this page. Copy whatever you like: the code is MIT licensed.
6 themes35 elements
Foundations
Tokens
Colour
--bgPage ground
--surfaceRaised: panels, inputs
--sunkenRecessed: wells, code, hover
--lineHairlines and dividers
--line-strongControl borders
--textBody text
--text-mutedSecondary text
--text-faintLabels and metadata
--accentThe one accent: selected, primary, on
--accent-inkAccent as text, contrast-safe
--posSuccess
--negError, destructive
Type
Quarterly numbers
Body copy sits at 16px with a line height around 1.55, held to a measure of roughly 65 characters so the eye can find the start of the next line.
Save a search from the results page and it shows up here with new matches
counted.
Code
HTML
<div class="empty"> <p class="empty-title">No saved searches</p> <p class="empty-text"> Save a search from the results page and it shows up here with new matches counted. </p> <button class="btn" type="button">Browse shows</button></div>
CSS
/* Left-aligned like the content it stands in for; the dashed edge marks the space as a slot waiting to be filled. */.empty { display: grid; justify-items: start; gap: var(--space-2); width: 100%; padding: var(--space-6); border: 1px dashed var(--line-strong); border-radius: var(--radius-m);}.empty p { margin: 0;}.empty-title { font-weight: 600;}.empty-text { max-width: 34rem; margin-bottom: var(--space-2); font-size: var(--text-sm); color: var(--text-muted);}
<button class="btn tip" type="button" data-tip="Copies the HTML only">Copy</button><a class="tip" href="#surfaces-tooltip" data-tip="Updated 2 days ago">Release notes</a>
CSS
/* CSS-only, for supplementary hints. The tip is decoration for sighted pointer and keyboard users; anything a screen reader needs belongs in the control's own text or aria-label. Shown on focus too, and always shown above its trigger. */.tip { position: relative;}.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + var(--space-2)); left: 50%; z-index: 20; padding: var(--space-1) var(--space-2); font: 500 var(--text-xs) / 1.4 var(--font-body); white-space: nowrap; color: var(--bg); background: var(--text); border-radius: min(var(--radius-s), 4px); translate: -50% var(--space-1); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease), translate var(--dur-fast) var(--ease);}.tip:hover::after,.tip:focus-visible::after { opacity: 1; translate: -50% 0; transition-delay: 300ms;}@media (prefers-reduced-motion: reduce) { .tip::after { transition: none; }}
Accordion
surfaces/accordion
Can I return tickets?
Up to 48 hours before curtain, for credit toward another performance.
Is there a dress code?
No. Bring a layer; theatres run cold in summer.
When do doors open?
Thirty minutes before the listed start time.
Code
HTML
<div class="accordion"> <details name="faq" open> <summary>Can I return tickets?</summary> <p>Up to 48 hours before curtain, for credit toward another performance.</p> </details> <details name="faq"> <summary>Is there a dress code?</summary> <p>No. Bring a layer; theatres run cold in summer.</p> </details> <details name="faq"> <summary>When do doors open?</summary> <p>Thirty minutes before the listed start time.</p> </details></div>
<p class="text-demo"> Read the <a class="link" href="#text-link">release notes</a> or the <a class="link link-external" href="https://developer.mozilla.org/" rel="noopener">MDN reference</a> before upgrading.</p>
Songs save as XML in the SONGS folder. Each file carries its
own tempo and key, so the stats page can sort by either.
Kits and synths are stored by reference.
Samples stay where they are on the card.
Renaming a sample folder breaks every song that points into it.
Code
HTML
<div class="prose"> <h3>Exporting a song</h3> <p> Songs save as XML in the <code>SONGS</code> folder. Each file carries its own tempo and key, so the stats page can sort by either. </p> <ul> <li>Kits and synths are stored by reference.</li> <li>Samples stay where they are on the card.</li> </ul> <blockquote> Renaming a sample folder breaks every song that points into it. </blockquote></div>
CSS
/* Long-form text. Blockquotes are used as asides, so no quote marks or italics. */.prose { max-width: 38rem; line-height: 1.65;}.prose > * + * { margin-top: var(--space-4);}.prose h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-stretch: var(--display-stretch, normal); letter-spacing: var(--display-tracking); text-transform: var(--display-case, none); font-size: var(--text-xl); line-height: 1.15;}.prose p,.prose li { text-wrap: pretty;}.prose ul { padding-left: var(--space-5);}.prose li + li { margin-top: var(--space-1);}.prose li::marker { color: var(--text-faint);}.prose code { padding: 0.1em 0.35em; font: 500 0.875em var(--font-mono); background: var(--sunken); border: 1px solid var(--line); border-radius: min(var(--radius-s), 4px);}.prose blockquote { margin-left: 0; margin-right: 0; padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--text-muted); background: var(--sunken); border-radius: var(--radius-m);}