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
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)
- CSSNumericValue
- CSSMathValue
Properties
Readonlyoperator
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".
Methods
add
-
The
add()method of the CSSNumericValue interface adds a supplied number to the CSSNumericValue.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
div
-
The
div()method of the CSSNumericValue interface divides the CSSNumericValue by the supplied value.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
equals
-
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.Parameters
- ...value: CSSNumberish[]
Returns boolean
max
-
The
max()method of the CSSNumericValue interface returns the highest value from among the values passed. The passed values must be of the same type.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
min
-
The
min()method of the CSSNumericValue interface returns the lowest value from among those values passed. The passed values must be of the same type.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
mul
-
The
mul()method of the CSSNumericValue interface multiplies the CSSNumericValue by the supplied value.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
sub
-
The
sub()method of the CSSNumericValue interface subtracts a supplied number from the CSSNumericValue.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
to
-
The
to()method of the CSSNumericValue interface converts a numeric value from one unit to another.Parameters
- unit: string
Returns CSSUnitValue
toString
-
Returns string
toSum
-
The
toSum()method of the CSSNumericValue interface converts the object's value to a CSSMathSum object to values of the specified unit.Parameters
- ...units: string[]
Returns CSSMathSum
type
-
The
type()method of the CSSNumericValue interface returns the type of CSSNumericValue, one of angle, flex, frequency, length, resolution, percent, percentHint, or time.Returns CSSNumericType
The
CSSMathValueinterface of the CSS Typed Object Model API a base class for classes representing complex numeric values.MDN Reference