axi-designv1.50.0

Shells

Scrim

The dimming layer between a dismissible surface and the page under it. The one translucent surface in the language.

.axi-scrim .axi-scrim--sheet

Rule 2 forbids colour at partial opacity over the ground, and the scrim is where that boundary is worth understanding: --axi-scrim is the ground itself at 72%, a neutral rather than an ink. Nothing is being made quieter by fading a colour - the layer's whole job is to take contrast out of what is behind it, which is what the ramp is for.

It is a <div> with border: 0 and the hidden attribute rather than a class, sitting one z-index below the drawer it belongs to. Clicking it closes the drawer; that wiring is the consumer's.

A scrim's layer is not a property of the scrim - it is "directly below the thing I dismiss" - so there are two. The default sits under the drawer-and-modal rung, which is where --axi-scrim's value was tuned. .axi-scrim--sheet is the same scrim one rung below .axi-sheet.

Reach for the modifier whenever the thing being dismissed is a sheet, because the default cannot do it and fails hard rather than visibly: the sheet's rung is below the default scrim's, both are position: fixed in one stacking context, so the scrim covers the sheet completely and every click lands on the dismiss handler. The sheet opens and then does nothing. A sheet wants a scrim despite being opaque, because --axi-sheet-top leaves a strip of live page above it and that strip is what the reader clicks to get out.

No motion is shipped for either. This language has no transition vocabulary, and a consumer that fades a scrim in owns those keyframes - and owns keeping them off the fill. An enter/exit class that also sets a background is a colour literal standing on top of --axi-scrim, which is how one consumer had quietly replaced the token with its own near-black.

The scrim over content

Shown in a positioned box rather than over the whole viewport

Behind the scrim

Still readable, and clearly not the thing you are being asked to look at.

<div style="position: relative; height: 140px; overflow: hidden">
  <div class="axi-panel">
    <p class="axi-eyebrow">Behind the scrim</p>
    <p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Still readable, and clearly not the thing you are being asked to look at.</p>
  </div>
  <div class="axi-scrim" style="position: absolute"></div>
</div>

Rules this answers