Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface CSSMathValue

The CSSMathValue interface of the CSS Typed Object Model API a base class for classes representing complex numeric values.

MDN Reference

interface CSSMathValue {
    operator: CSSMathOperator;
    add(...values: CSSNumberish[]): CSSNumericValue;
    div(...values: CSSNumberish[]): CSSNumericValue;
    equals(...value: CSSNumberish[]): boolean;
    max(...values: CSSNumberish[]): CSSNumericValue;
    min(...values: CSSNumberish[]): CSSNumericValue;
    mul(...values: CSSNumberish[]): CSSNumericValue;
    sub(...values: CSSNumberish[]): CSSNumericValue;
    to(unit: string): CSSUnitValue;
    toString(): string;
    toSum(...units: string[]): CSSMathSum;
    type(): CSSNumericType;
}

Hierarchy (View Summary)

Index
operator: CSSMathOperator

The CSSMathValue.operator read-only property of the CSSMathValue interface indicates the operator that the current subtype represents. For example, if the current CSSMathValue subtype is CSSMathSum, this property will return the string "sum".

MDN Reference

  • The equals() method of the CSSNumericValue interface returns a boolean indicating whether the passed value are strictly equal. To return a value of true, all passed values must be of the same type and value and must be in the same order. This allows structural equality to be tested quickly.

    MDN Reference

    Parameters

    Returns boolean

  • The toSum() method of the CSSNumericValue interface converts the object's value to a CSSMathSum object to values of the specified unit.

    MDN Reference

    Parameters

    • ...units: string[]

    Returns CSSMathSum

Was this helpful?