SassCalculation class final
A SassScript calculation.
Although calculations can in principle have any name or any number of arguments, this class only exposes the specific calculations that are supported by the Sass spec. This ensures that all calculations that the user works with are always fully simplified.
- Inheritance
- Available extensions
Properties
-
arguments
→ List<
Object> -
The calculation's arguments.
final
-
asList
→ List<
Value> -
This value as a list.
no setterinherited
- hasBrackets → bool
-
Whether this value as a list has brackets.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- isTruthy → bool
-
Whether the value counts as
truein an@ifstatement and other contexts.no setterinherited - name → String
-
The calculation's name, such as
"calc".final - realNull → Value?
-
Returns Dart's
nullvalue if this is sassNull, and returnsthisotherwise.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → ListSeparator
-
The separator for this value as a list.
no setterinherited
Methods
-
assertBoolean(
[String? name]) → SassBoolean -
Throws a
SassScriptExceptionifthisisn't a boolean.inherited -
assertCalculation(
[String? name]) → SassCalculation -
Throws a
SassScriptExceptionifthisisn't a calculation.override -
assertColor(
[String? name]) → SassColor -
Throws a
SassScriptExceptionifthisisn't a color.inherited -
assertComplexSelector(
{String? name, bool allowParent = false}) → ComplexSelector -
Available on Value, provided by the SassApiValue extension
Parsesthisas a complex selector, in the same manner as theselector-parse()function. -
assertCompoundSelector(
{String? name, bool allowParent = false}) → CompoundSelector -
Available on Value, provided by the SassApiValue extension
Parsesthisas a compound selector, in the same manner as theselector-parse()function. -
assertFunction(
[String? name]) → SassFunction -
Throws a
SassScriptExceptionifthisisn't a function reference.inherited -
assertMap(
[String? name]) → SassMap -
Throws a
SassScriptExceptionifthisisn't a map.inherited -
assertMixin(
[String? name]) → SassMixin -
Throws a
SassScriptExceptionifthisisn't a mixin reference.inherited -
assertNumber(
[String? name]) → SassNumber -
Throws a
SassScriptExceptionifthisisn't a number.inherited -
assertSelector(
{String? name, bool allowParent = false}) → SelectorList -
Available on Value, provided by the SassApiValue extension
Parsesthisas a selector list, in the same manner as theselector-parse()function. -
assertSimpleSelector(
{String? name, bool allowParent = false}) → SimpleSelector -
Available on Value, provided by the SassApiValue extension
Parsesthisas a simple selector, in the same manner as theselector-parse()function. -
assertString(
[String? name]) → SassString -
Throws a
SassScriptExceptionifthisisn't a string.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sassIndexToListIndex(
Value sassIndex, [String? name]) → int -
Converts
sassIndexinto a Dart-style index into the list returned by asList.inherited -
toCssString(
{bool quote = true}) → String -
Returns a valid CSS representation of
this.inherited -
toString(
) → String -
Returns a string representation of
this.inherited -
tryMap(
) → SassMap? -
Returns
thisas a SassMap if it is one (including empty lists, which count as empty maps) or returnsnullif it's not.inherited -
withListContents(
Iterable< Value> contents, {ListSeparator? separator, bool? brackets}) → SassList -
Returns a new list containing
contentsthat defaults to this value's separator and brackets.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
abs(
Object argument) → Value -
Creates an
abs()calculation with the givenargument. -
acos(
Object argument) → Value -
Creates an
acos()calculation with the givenargument. -
asin(
Object argument) → Value -
Creates an
asin()calculation with the givenargument. -
atan(
Object argument) → Value -
Creates an
atan()calculation with the givenargument. -
atan2(
Object y, Object? x) → Value -
Creates a
atan2()calculation foryandx. -
calc(
Object argument) → Value -
Creates a
calc()calculation with the givenargument. -
calcSize(
Object basis, Object? value) → SassCalculation -
Creates an
calc-size()calculation with the givenbasisandvalue. -
clamp(
Object min, [Object? value, Object? max]) → Value -
Creates a
clamp()calculation with the givenmin,value, andmax. -
cos(
Object argument) → Value -
Creates a
cos()calculation with the givenargument. -
exp(
Object argument) → Value -
Creates an
exp()calculation with the givenargument. -
hypot(
Iterable< Object> arguments) → Value -
Creates a
hypot()calculation with the givenarguments. -
log(
Object number, Object? base) → Value -
Creates a
log()calculation with the givennumberandbase. -
max(
Iterable< Object> arguments) → Value -
Creates a
max()calculation with the givenarguments. -
min(
Iterable< Object> arguments) → Value -
Creates a
min()calculation with the givenarguments. -
mod(
Object dividend, Object? modulus) → Value -
Creates a
mod()calculation with the givendividendandmodulus. -
operate(
CalculationOperator operator, Object left, Object right) → Object -
Creates and simplifies a CalculationOperation with the given
operator,left, andright. -
pow(
Object base, Object? exponent) → Value -
Creates a
pow()calculation with the givenbaseandexponent. -
rem(
Object dividend, Object? modulus) → Value -
Creates a
rem()calculation with the givendividendandmodulus. -
round(
Object strategyOrNumber, [Object? numberOrStep, Object? step]) → Value -
Creates a
round()calculation with the givenstrategyOrNumber,numberOrStep, andstep. Strategy must be either nearest, up, down or to-zero. -
sign(
Object argument) → Value -
Creates a
sign()calculation with the givenargument. -
sin(
Object argument) → Value -
Creates a
sin()calculation with the givenargument. -
sqrt(
Object argument) → Value -
Creates a
sqrt()calculation with the givenargument. -
tan(
Object argument) → Value -
Creates a
tan()calculation with the givenargument.