Skip to main content

Module calc

Module calc 

Source
Expand description

Re-exports§

pub use self::GenericCalcNode as CalcNode;

Macros§

compare_helpers 🔒

Structs§

CalcNodeWithLevel 🔒
CalcUnits
Expected units we allow parsing within a calc() expression.
GenericAnchorFunctionFallback
Fallback type for anchor functions within calc(). Ideally, the fallback type is initial type of the property (e.g. GenericInset for left), but that causes circular reference. TODO(dshin, bug 2034100): Investigate ways to not require this. This handles the parsing of unitless zeros, as well as ensuring that e.g. calc(anchor(--foo left, 1px) + 10%) round trips (sorting aside), instead of becoming calc(anchor(--foo left, calc(1px)) + 10%).

Enums§

ArgumentLevel 🔒
The level of any argument being serialized in to_css_impl.
GenericCalcNode
A generic node in a calc expression.
MinMaxOp
Whether we’re a min or max function.
ModRemOp
Whether we’re a mod or rem function.
PositivePercentageBasis
For percentage resolution, sometimes we can’t assume that the percentage basis is positive (so we don’t know whether a percentage is larger than another).
RoundingStrategy
The strategy used in round()
SortKey
This determines the order in which we serialize members of a calc() sum.

Traits§

CalcNodeLeaf
A trait that represents all the stuff a valid leaf of a calc expression.

Type Aliases§

GenericCalcAnchorFunction
anchor() function used in math functions.
GenericCalcAnchorSizeFunction
anchor-size() function used in math functions.