A cache for caching the results of a sizing a Grid Item or Flexbox Item
A set of margins that are available for collapsing with for block layout’s margin collapsing
The final result of a layout algorithm for a single node.
A struct containing the inputs constraints/hints for laying out a node, which are passed in by the parent
A struct containing the result of laying a single node, which is returned up to the parent node
An abstract “line”. Represents any type that has a start and an end
Generic struct which holds a “min” value and a “max” value
A type representing the id of a single node in a tree of nodes
A 2-dimensional coordinate.
An axis-aligned UI rectangle
The width and height of a
Rect
A typed representation of the CSS style information for a single node.
An entire tree of UI nodes. The entry point to Taffy’s high-level API.
The simple absolute horizontal and vertical axis
Sets the distribution of space between and around content items
For Flexbox it controls alignment in the cross axis
For Grid it controls alignment in the block axis
Used to control how child nodes are aligned.
For Flexbox it controls alignment in the cross axis
For Grid it controls alignment in the block axis
A unit of linear measurement
Sets the layout used for the children of this node
The direction of the flexbox layout main axis.
Controls whether flex items are forced onto one line or can wrap onto multiple lines.
Controls whether grid items are placed row-wise or column-wise. And whether the sparse or dense packing algorithm is used.
The first argument to a repeated track definition. This type represents the type of automatic repetition to perform.
A unit of linear measurement
A unit of linear measurement
Maximum track sizing function
Minimum track sizing function
How children overflowing their container should affect layout
The positioning strategy for this item.
An axis that layout algorithms can be requested to compute a size for
Whether we are performing a full layout, or we merely need to size the node
Whether styles should be taken into account when computing size
An error that occurs while trying to access or modify a node’s children by index.
Trait to create constant percent values from plain numbers
Trait to create absolute length values from plain numbers
Trait to create constant percent values from plain numbers
A trait to conveniently calculate minimums and maximums when some data may not be defined
Trait to encapsulate behaviour where we need to resolve from a
potentially context-dependent size or dimension into
a context-independent size or dimension.
Trait used by the print_tree
method which prints a debug representation
Trait to encapsulate behaviour where we need to resolve from a
potentially context-dependent size or dimension into
a context-independent size or dimension.
Trait used by the round_layout
method which takes a tree of unrounded float-valued layouts and performs
rounding to snap the values to the pixel grid.
Trait to abstract over auto values
Trait to create fit-content(…)
values from plain numbers
Trait to abstract over grid line values
Trait to abstract over grid span values
Trait to abstract over max_content values
Trait to abstract over min_content values
Trait to abstract over zero values
This trait is Taffy’s abstraction for downward tree traversal.
However, this trait does not require access to any node’s other than a single container node’s immediate children unless you also intend to implement TraverseTree
.
A marker trait which extends TraversePartialTree
with the additional guarantee that the child/children methods can be used to recurse
infinitely down the tree. Is required by the RoundTree
and the PrintTree
traits.
Returns the auto value for that type
Attempts to find a cached layout for the specified node and layout inputs.
Grid layout algorithm
This consists of a few phases:
Creates a layout for this node and its children, recursively.
Each hidden node has zero size and is placed at the origin
Compute the size of a leaf node (node with no children)
Compute layout for the root node in the tree
Returns a grid template containing count
evenly sized tracks
Returns a value of the inferred type which represent a fit-content(…)
value
with the given argument.
Shorthand for minmax(0, Nfr). Probably what you want if you want exactly evenly sized tracks.
Create a Fraction
track sizing function (fr
in CSS)
Returns a value of the inferred type which represent an absolute length
Specifies a grid line to place a grid item between in CSS Grid Line coordinates:
Returns the auto value for that type
Returns the auto value for that type
Returns a MinMax with min value of min and max value of max
Returns a value of the inferred type which represent a percentage
Prints a debug representation of the computed layout for a tree of nodes, starting with the passed root node.
Returns an auto-repeated track definition
Rounds the calculated layout to exact pixel values
Returns a GridPlacement::Span
Returns the zero value for that type
Used to control how the specified nodes is aligned.
Overrides the parent Node’s AlignItems
property.
For Flexbox it controls alignment in the cross axis
For Grid it controls alignment in the block axis
A grid line placement specification. Used for grid-[row/column]-[start/end]. Named tracks are not implemented.
Sets the distribution of space between and around content items
For Flexbox it controls alignment in the main axis
For Grid it controls alignment in the inline axis
Used to control how child nodes are aligned.
Does not apply to Flexbox, and will be ignored if specified on a flex container
For Grid it controls alignment in the inline axis
Used to control how the specified nodes is aligned.
Overrides the parent Node’s JustifyItems
property.
Does not apply to Flexbox, and will be ignored if specified on a flex child
For Grid it controls alignment in the inline axis
The sizing function for a grid track (row/column) (either auto-track or template track)
May either be a MinMax variant which specifies separate values for the min-/max- track sizing functions
or a scalar value which applies to both track sizing functions.
The error Taffy generates on invalid operations