CSSMathNegate: value property

Baseline 2026
Newly available

Since November 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Want more browser support for this feature? Tell us why.

Note: This feature is available in Web Workers.

The value read-only property of the CSSMathNegate interface returns the CSSNumericValue that is being negated.

This is the value passed to the constructor, converted to a CSSNumericValue if it isn't one already. If a plain number was passed to the constructor the value returned by this property is the passed value wrapped in a CSSUnitValue with unit: "number".

Value

A CSSNumericValue or one of its derived types.

Examples

Basic usage

The following code creates a CSSMathNegate object, then reads its value.

In this case, we passed CSS.px(10), so value is a CSSUnitValue. Passing a composite expression such as CSS.px(10).add(CSS.percent(5)) would result in value returning a CSSMathSum.

js
const negated = new CSSMathNegate(CSS.px(10));

console.log(negated.value); // CSSUnitValue {value: 10, unit: "px"}

Specifications

Specification
CSS Typed OM Level 1
# dom-cssmathnegate-value

Browser compatibility

See also