2

Context

I interpret clamp(MIN, VAL, MAX) to mean: Aim for VAL unless it exceeds MAX or falls below MIN.

When applied to WIDTH of text, my understanding is that the text element will take 100% of the container width unless it falls below MIN or exceeds MAX.

According to Mozilla, https://developer.mozilla.org/en-US/docs/Web/CSS/clamp()

clamp(MIN, VAL, MAX) is resolved as max(MIN, min(VAL, MAX))

In Firefox 87, the two behave differently.

The clamp VAL 100% ignores the MIN and MAX values, whereas it behaves as expected in max(MIN, min(VAL, MAX)).


Here is an example at wide width:

enter image description here


Headscratching

I'm not sure if this is a bug in FF 87 I should report or if there is something I'm not understanding about how clamp works. Seems to work OK in Chrome 89.

gabrimo
  • 53
  • 6

0 Answers0