CSSMathClamp: CSSMathClamp() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The CSSMathClamp() constructor creates a new CSSMathClamp object representing a CSS clamp() function.

Syntax

js
new CSSMathClamp(lower, value, upper)

Parameters

lower

A CSSNumericValue object – either a number or CSSUnitValue – representing the minimum value.

value

A CSSNumericValue object – either a number or CSSUnitValue – representing the preferred value.

upper

A CSSNumericValue object – either a number or CSSUnitValue – representing the maximum value.

Exceptions

TypeError

Thrown if there is a failure when adding the three arguments.

Examples

To do

Specifications

Specification
CSS Typed OM Level 1
# dom-cssmathclamp-cssmathclamp

Browser compatibility