Press feedback and hold

Scale presses to 0.97; make deletes a slow hold that snaps back.

From find-animation-opportunities and improve-animations.

How much should a button give?

Press each button, then change the duration.

OK
Four press depthsTune
No :activeNone
scale(0.97)Default
scale(0.95)Upper limit
scale(0.90)Too much
transition: transform 160ms var(--ease-out)
.btn {
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.btn:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

Delete: click vs. hold

Click each once by accident, then hold the right one.

Plain clickBad
Acme Books12 members · 3,204 files
click → delete
Hold to confirmGood
Acme Books12 members · 3,204 files
hold 2s → delete

Keep the button pressed until it fills to confirm. Release early to cancel.

.hold { position: relative; overflow: hidden; }
.hold .fill {
  position: absolute; inset: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.hold[data-holding] .fill {
  clip-path: inset(0 0 0 0);
  transition: clip-path 2s linear;
}

Press slow, release fast

Hold each halfway, let go, and compare the drain.

Symmetric releaseBad
release: clip-path 2s linear
Asymmetric releaseGood
release: clip-path 200ms ease-out
.fill                  { transition: clip-path 200ms var(--ease-out); } /* release */
[data-holding] .fill   { transition: clip-path 2s linear; }             /* press   */

Why it matters, pros and cons

Why it matters

An unanswered press gets pressed again; a hold spends time only while deciding.

Pros

  • Pure CSS press: one transform transition.
  • Stops slips without a modal.
  • Fast release makes cancel obvious.

Cons

  • Past 0.95 a press reads as a bounce.
  • Holds are hidden: label them and support Space/Enter.
  • Reversible deletes: a click plus Undo is faster.