Interface CSSUnitValue
interface CSSUnitValue {
unit: string;
value: number;
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;
}
unit: string;
value: number;
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
- CSSNumericValue
- CSSUnitValue (View Summary)
Properties
Readonlyunit
unit: string
The CSSUnitValue.unit read-only property of the CSSUnitValue interface returns a string indicating the type of unit.
value
value: number
The CSSUnitValue.value property of the A double.
Methods
add
div
equals
The
equals()method of the value are strictly equal.Parameters
- ...value: CSSNumberish[]
Returns boolean
max
min
mul
The
mul()method of the the supplied value.Parameters
- ...values: CSSNumberish[]
Returns CSSNumericValue
sub
to
toString
Returns string
toSum
The
toSum()method of thejs-nolint toSum(units)-units- : The units to convert to.Parameters
- ...units: string[]
Returns CSSMathSum
type
The
type()method of theCSSNumericValue, one ofangle,flex,frequency,length,resolution,percent,percentHint, ortime.Returns CSSNumericType
The
CSSUnitValueinterface of the CSS Typed Object Model API represents values that contain a single unit type.MDN Reference