Value

Swift
public indirect enum Value: Hashable, Equatable, CustomStringConvertible

A subexpression of a SassCalculation.


Topics

case number(SassNumber)

A number with optional associated units. See number(_:unit:).

Declaration
Swift
case number(SassNumber)

case string(String)

A string - expected to be a Sass variable for later evaluation, for example the $width part of calc($width / 2).

Declaration
Swift
case string(String)

case interpolation(String)

A string - expected to be a Sass variable, but this form means the stylesheet has #{$width} instead of $width. Use string(_:) instead when building your own Values.

Declaration
Swift
case interpolation(String)

case operation(Value, Operator, Value)

A binary arithmetic expression.

Declaration
Swift
case operation(Value, Operator, Value)

case calculation(SassCalculation)

A nested calculation.

Declaration
Swift
case calculation(SassCalculation)

Helpers

static func number(Double, unit: String?) -> Value

A helper to construct number(_:)s.

Declaration
Swift
public static func number(_ double: Double, unit: String? = nil) -> Value

Misc

var description: String

A human-readable description of the value.

Declaration
Swift
public var description: String { get }