Back to the library

Setting — tracked caps

Variant: Tracked caps

An all-caps label set at the tracking meant for lowercase, then opened by 0.1em. Capitals are designed to sit next to lowercase letters, so a run of them at default spacing looks cramped. Letter-spacing is a layout property, so the change is played as one transform per glyph: letter n moves n × 0.1em, which is exactly where letter-spacing would put it. All thirteen move in the same 336ms in-out window, because tracking is one setting and a stagger would look like the word unzipping. The proof mark is a rule made of one segment per glyph. At the tight setting the segments join into one line, and as the letters open up the rule breaks at every letter, which shows the added space directly instead of asking the eye to compare widths. Reach for it when documenting why eyebrows, badges and button labels in caps carry letter-spacing that body text does not.

texttypographyloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Setting — tracked caps</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --round: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex
           (#d97757 / #b85c3e / #788c5d / #b04a3f). */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — 5.6s, shared across the setting family. The proof mark goes
           down at 16%, the correction lands by 32%, the mark is lifted by
           56%, and the card resets inside a blank window at 93%. */
        --cycle: 5.6s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

        --_read: color-mix(in srgb, var(--slate) 78%, transparent);
        --_quiet: color-mix(in srgb, var(--slate) 55%, transparent);

        /* Tracking added to the capitals. Letter-spacing adds the same space
           after every glyph, so letter n travels exactly n times this. */
        --_track: 0.1em;
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        padding: clamp(12px, 3vw, 28px);
        background: var(--ivory);
        color: var(--slate);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
      }

      .sheet {
        width: min(360px, 92vw);
        padding: clamp(14px, 3.4vw, 22px) clamp(16px, 3.8vw, 26px);
        border: 1px solid var(--oat);
        border-radius: calc(14px * var(--round));
        background: var(--paper);
      }

      /* The whole set resets inside one blank window, so the loop never shows
         the correction being undone — a fix that visibly reverses reads as a
         second animation with the opposite meaning. */
      .stage {
        animation: seam var(--t) infinite;
      }

      .eyebrow {
        font-size: clamp(11px, 2.4vw, 12.5px);
        font-weight: 600;
        letter-spacing: 0.09em;
        text-transform: uppercase;
        color: var(--_quiet);
      }

      .foot {
        margin-top: clamp(12px, 2.6vw, 16px);
        padding-top: clamp(9px, 2vw, 12px);
        border-top: 1px solid var(--oat);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px 12px;
      }

      .foot code {
        font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
        font-size: clamp(11px, 2.6vw, 12.5px);
        color: var(--_quiet);
        white-space: nowrap;
      }

      /* The state chip rolls on a two-row track rather than crossfading, so no
         frame has both words legible. */
      .chip {
        height: calc(1.6em + 2px);
        overflow: hidden;
        padding: 0 0.7em;
        border: 1px solid var(--oat);
        border-radius: 999px;
        font-size: clamp(11px, 2.5vw, 12px);
        font-weight: 600;
        line-height: 1.6em;
        color: var(--_quiet);
      }

      .track {
        display: block;
        animation: roll var(--t) infinite;
      }

      .track > span {
        display: block;
        white-space: nowrap;
      }

      .track .set {
        color: var(--slate);
      }

      .track .set::before {
        content: '';
        display: inline-block;
        width: 0.45em;
        height: 0.45em;
        margin-right: 0.4em;
        border-radius: 50%;
        background: var(--olive);
        vertical-align: 0.08em;
      }

      @keyframes roll {
        0%,
        32% {
          transform: translateY(0);
          animation-timing-function: var(--ease-out);
        }
        36%,
        92.9% {
          transform: translateY(-50%);
        }
        93%,
        100% {
          transform: translateY(0);
        }
      }

      @keyframes seam {
        0%,
        88% {
          opacity: 1;
          animation-timing-function: ease;
        }
        92%,
        94% {
          opacity: 0;
          animation-timing-function: ease;
        }
        98%,
        100% {
          opacity: 1;
        }
      }

      .label {
        margin-top: clamp(2px, 0.6vw, 4px);
        font-size: clamp(15px, 4.2vw, 19px);
        font-weight: 650;
        line-height: 1.3;
        white-space: nowrap;
        color: var(--clay-d);
      }

      /* Each glyph is its own box carrying its index, so tracking — which is
         letter-spacing, a layout property — can be played as thirteen
         transforms that land on exactly the positions letter-spacing would
         give. All of them on one curve in one window: tracking is a single
         setting, and a stagger would read as the word unzipping. */
      .glyphs > span {
        position: relative;
        display: inline-block;
        animation: track var(--t) infinite;
      }

      /* The proof mark is a rule built from one segment per glyph. Untracked,
         the segments abut into a single line; as the capitals open up, the
         rule breaks at every letter, which draws the inserted space instead
         of asking the eye to compare widths. */
      .glyphs > span::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -0.16em;
        height: 2px;
        background: var(--clay);
        animation: tick var(--t) infinite;
      }

      .glyphs > .sp::after {
        content: none;
      }

      .sr {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
      }

      .title {
        margin-top: clamp(6px, 1.4vw, 9px);
        font-size: clamp(16px, 4vw, 19px);
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: -0.012em;
      }

      .lede {
        margin-top: clamp(3px, 0.8vw, 5px);
        font-size: clamp(13px, 3.2vw, 14.5px);
        line-height: 1.45;
        color: var(--_read);
      }

      @keyframes track {
        0%,
        26% {
          transform: translateX(0);
          animation-timing-function: var(--ease-in-out);
        }
        32%,
        92.9% {
          transform: translateX(calc(var(--i) * var(--_track)));
        }
        93%,
        100% {
          transform: translateX(0);
        }
      }

      @keyframes tick {
        0%,
        16% {
          opacity: 0;
          animation-timing-function: ease;
        }
        23%,
        46% {
          opacity: 1;
          animation-timing-function: ease;
        }
        56%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Every travel distance in the piece goes to zero time — positions cut
           between their two states inside a frame — while the proof marks,
           which say what is about to change and that it changed, keep fading
           on a slower clock. */
        .stage,
        .track,
        .glyphs > span,
        .glyphs > span::after {
          animation-duration: calc(var(--t) * 1.7);
        }

        .track {
          animation-name: roll-rm;
        }

        @keyframes roll-rm {
          0%,
          32.9% {
            transform: translateY(0);
          }
          33%,
          92.9% {
            transform: translateY(-50%);
          }
          93%,
          100% {
            transform: translateY(0);
          }
        }

        .glyphs > span {
          animation-name: track-rm;
        }

        @keyframes track-rm {
          0%,
          28.9% {
            transform: translateX(0);
          }
          29%,
          92.9% {
            transform: translateX(calc(var(--i) * var(--_track)));
          }
          93%,
          100% {
            transform: translateX(0);
          }
        }
      }
    </style>
  </head>
  <body>
    <div class="sheet">
      <div class="stage">
        <p class="label">
          <span class="sr">Build shipped</span
          ><span class="glyphs" aria-hidden="true"
            ><span style="--i: 0">B</span><span style="--i: 1">U</span><span style="--i: 2">I</span
            ><span style="--i: 3">L</span><span style="--i: 4">D</span
            ><span class="sp" style="--i: 5">&nbsp;</span><span style="--i: 6">S</span
            ><span style="--i: 7">H</span><span style="--i: 8">I</span><span style="--i: 9">P</span
            ><span style="--i: 10">P</span><span style="--i: 11">E</span
            ><span style="--i: 12">D</span></span
          >
        </p>
        <p class="title">Cache survives a branch switch</p>
        <p class="lede">Warm starts drop from 41s to 6s.</p>
        <div class="foot">
          <code>letter-spacing: 0.1em</code>
          <span class="chip" aria-hidden="true"
            ><span class="track"><span>as typed</span><span class="set">as set</span></span></span
          >
        </div>
      </div>
    </div>
  </body>
</html>