clampCss

fun clampCss(value: Dp, min: Dp?, max: Dp?): Dp

Clamp a Dp to a CSS min/max range.

Mirrors the CSS used-value rules (CSS 2.1 §10.4 / CSS-Sizing-3): the max bound is applied first and the min bound second, so min wins when min > max. A null bound means "unbounded" on that side. Unlike Dp.coerceIn, this never throws when min > max.