Press Scale
A utility class that dips an element while it is pressed.
Installation
press-scale comes with @kappa-ui/core/tailwind.css, which the components that draw with it import through the tokens item; there is no separate item.
Usage
It is a utility rather than a prop, so it composes with anything:
<Button class="press-scale">Press me</Button>
The element dips to --press-scale over --press-duration while held; on a component with a transition of its own, such as Button, the dip takes that transition's duration instead. On .is-mobile it switches to scale3d so the animation stays on the compositor, and honours --transform-extra if you are already applying a transform. Nothing here sets .is-mobile — that is your application's job. Under prefers-reduced-motion: reduce both the transition and the transform are dropped.
| Variable | Default | Description |
|---|---|---|
| --press-scale | 0.97 | Scale while pressed. |
| --press-duration | 120ms | Duration of the dip and the return. |
| --transform-extra | none | A transform to keep applying under .is-mobile. |