# Shimmer

A utility class that moves a band of light across a line of text, to show that something is in progress.

This is the HTML to build it with `dex.css`, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/shimmer shows the Dex app's own utility classes, which only work inside the Dex codebase.

## HTML

`dex.css` has no shimmer. The closest is a few lines of CSS of your own: a gradient of the text colour that softens towards the page colour in the middle, clipped to the letters and moved across them every two seconds. Set the text colour with `--c`; it defaults to the muted grey.

```html
<style>
  .shimmer {
    --c: var(--dex-muted-foreground);
    background: linear-gradient(
        110deg,
        var(--c) 40%,
        color-mix(in oklab, var(--c) 35%, var(--dex-background)) 50%,
        var(--c) 60%
      )
      0 0 / 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 2s linear infinite;
  }
  @keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .shimmer { animation: none; background: none; color: var(--c); }
  }
</style>

<p class="dex-small"><span class="shimmer">Reading Synthesia's role…</span></p>
```

- **While something is running**: add the class when the work starts and take it off when it's done.
- **Colour**: set `--c` to another token, such as `var(--dex-foreground)`.
- **Once**: `animation-iteration-count: 1`, then the text is plain.

## Rules

- Shimmer is for a line of status text while something is happening. In the Dex chat it's on the typing indicator and on the status line of a tool Dex is running ("Reading your CV…").
- Take it off when the work is done, so a finished status is still.
- Content that hasn't loaded yet has a skeleton (https://brand.meetdex.ai/components/skeleton.md). A button that's working changes its label instead.
- Only the letters are lit: no box or background behind them.
