Four opacities — 0.08 hover, 0.12 focus, 0.12 press, 0.16 drag — give every control on this page its states, on five different shapes, over two different surfaces, in light and dark. None of them names a colour. The state is a film of the control’s own foreground mixed into its own background, so a palette nobody has designed yet already works.
.st{
--fill:var(--surface-container-high);
--onFill:var(--on-surface);
background:var(--fill); color:var(--onFill);
transition:background var(--press-out) var(--m-ease-standard);
}
.st:hover { background:color-mix(in oklch, var(--onFill) calc(var(--state-hover)*100%), var(--fill)) }
.st:focus-visible{ outline:2px solid var(--primary); outline-offset:3px;
background:color-mix(in oklch, var(--onFill) calc(var(--state-focus)*100%), var(--fill)) }
.st:active { background:color-mix(in oklch, var(--onFill) calc(var(--state-press)*100%), var(--fill));
translate:0 1px; transition-duration:var(--press-in) }
/* a control that carries BODY TEXT at rest puts the film on a sibling */
.s-row{ isolation:isolate }
.s-row .film{ position:absolute; inset:0; z-index:-1; background:transparent }
.s-row:hover .film{ background:color-mix(in oklch, var(--on-surface) 8%, var(--surface-container-lowest)) }Every mix is opaque. An
rgba overlay would look identical in a screenshot and would promote the element to
its own compositor layer, which on Windows drops sub-pixel anti-aliasing and makes the label look
soft. That is the difference between a state layer and a tint.