Table of Contents

Class CSSNumericValue

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The CSSNumericValue interface of the CSS Typed Object Model API represents operations that all numeric values can perform.

[Value("CSSNumericValue")]
public class CSSNumericValue : CSSStyleValue
Inheritance
CSSNumericValue
Derived
Inherited Members

Remarks

-'CSSImageValue'
-'CSSKeywordValue'
-'CSSPositionValue'
-'CSSTransformValue'
-'CSSUnparsedValue'

See also on MDN

Constructors

CSSNumericValue()

public CSSNumericValue()

Methods

Add(params Union13[])

The add() method of the
CSSNumericValue interface adds a supplied number to the
CSSNumericValue.

[Value("add")]
public CSSNumericValue Add(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSMathSum'

Remarks

Div(params Union13[])

The div() method of the
CSSNumericValue interface divides the CSSNumericValue by the
supplied value.

[Value("div")]
public CSSNumericValue Div(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSMathProduct'.

Remarks

Equals(params Union13[])

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.

[Value("equals")]
public bool Equals(params Union13[] value)

Parameters

value Union13[]

Returns

bool

A boolean value.

Remarks

Max(params Union13[])

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.

[Value("max")]
public CSSNumericValue Max(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSUnitValue'.

Remarks

Min(params Union13[])

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.

[Value("min")]
public CSSNumericValue Min(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSUnitValue'.

Remarks

Mul(params Union13[])

The mul() method of the
CSSNumericValue interface multiplies the CSSNumericValue by
the supplied value.

[Value("mul")]
public CSSNumericValue Mul(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSMathProduct'

Remarks

Parse(string)

The parse() static method of the
CSSNumericValue interface converts a value string into an object whose
members are value and the units.

[Value("parse")]
public static CSSNumericValue Parse(string cssText)

Parameters

cssText string

Returns

CSSNumericValue

A 'CSSNumericValue'.

Remarks

Sub(params Union13[])

The sub() method of the
CSSNumericValue interface subtracts a supplied number from the
CSSNumericValue.

[Value("sub")]
public CSSNumericValue Sub(params Union13[] values)

Parameters

values Union13[]

Returns

CSSNumericValue

A 'CSSMathSum'

Remarks

To(string)

The to() method of the
CSSNumericValue interface converts a numeric value from one unit to
another.

[Value("to")]
public CSSUnitValue To(string unit)

Parameters

unit string

Returns

CSSUnitValue

A 'CSSMathSum'.

Remarks

ToSum(params string[])

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

[Value("toSum")]
public CSSMathSum ToSum(params string[] units)

Parameters

units string[]

Returns

CSSMathSum

A 'CSSMathSum'.

Remarks

Type()

The type() method of the
CSSNumericValue interface returns the type of
CSSNumericValue, one of angle, flex,
frequency, length, resolution,
percent, percentHint, or time.

[Value("type")]
public CSSNumericType Type()

Returns

CSSNumericType

A CSSNumericType dictionary, which contains the following properties:For each property except percentHint, the value is an integer representing the power of that unit. For example, a numeric value of calc(1px * 1em) will return { length: 2 }.The percentHint property is a string that indicates the type of value that the percent is applied to. The string value is the same as the type properties: "length", "angle", "time", "frequency", "resolution", "flex", or "percent". It indicates that the type actually holds a percentage, but that percentage will eventually resolve to the hinted base type, and so has been replaced with it in the type.

Remarks