v0.12.1
This release container a couple of critical fixes for layout/caching bugs in the 0.12.0 release.
- Block: don't commit deferred in-flow layouts to the tree when only computing size (#971)
- Block: pass through the requested
run_modewhen performing final layout on in-flow children, instead of always usingMeasureSize(#972)
v0.12.0
The MSRV for this release is 1.71.
Block containers now implement align_content along the block axis for their in-flow children.
- The cache key now includes the axis, parent size, and available space, and ignores available space in an axis when a known dimension is set there. This is a performance hit (~10% in common cases, ~60% in pathalogically ones) but is necessary for correctness. It does also enable early-return optimizations (in cases where only the horizontal size is needed, which can allow that performance to be recouped in some cases (#911)
- Flexbox: fall back to safe
align-selfofstarton absolute-position overflow (#958) - Block: derive definite height from
aspect-ratioat final layout. A block container withaspect-ratioand an automatic height now becomes definite when its width is filled/stretched, so children's percentage heights resolve correctly and the ratio is preserved (#965)
v0.11.0
The MSRV for this release is 1.71.
Taffy now implements safe alignment (in addition to unsafe alignment).
The alignment style types are now structs consisting of an AlignmentKeyword and an AlignmentSafety modifier. For most users this will mean changing from using enum variants like AlignContent::Start to associated constants like AlignContent::START.
This change applies to the AlignContent, JustifyContent, AlignItems, JustifyItems, AlignSelf, and JustifySelf types.
- Grid: resolve item percentages against grid area rather than grid container (#960)
v0.10.0
The MSRV for this release is 1.71.
The direction property is now supported, allowing for RTL layout of boxes in Block, Flexbox, and CSS Grid layout modes.
The float and clear properties are now supported. Support consists of a general-purpose FloatContext in the compute module, and integration of float layout into Block layout. Block layout now also has a BlockContext that allows a FloatContext to be shared across an entire Block formatting context.
Float support is feature flagged by the float_layout feature.
All of Taffy's style types (except the top-level Style struct) now have FromStr implementations that parses the type from the CSS representation of that value (e.g. 30px or 50% for LengthPercentage. A future version of Taffy will likely add support for parsing Style from ;-seperated CSS.
CSS parsing is feature flagged by the parse feature.
- Make
DetailedGridTracksInfostruct accessible from a public module (#899) - Add
TaffyTree::write_treemethod to debug print the tree into an arbitrary writer (#925) - The cache
setandsetAPIs now take&LayoutInputrather than individual values (#933)
- Flexbox: apply gap even when there are auto margins (#938)
v0.9.0
Taffy now supports named grid lines and areas.
As these rely on arbitrary user-provided strings, Taffy's Style struct is now generic over a string-like type (via the CheapCloneStr trait). Additionally as the grid feature is optional, it has a PhantomData field of that type to make type inference work.
PrintTreeandRoundTree: useLayoutinstead of&Layout(#849).- Renamed
TrackSizingFunctiontoGridTemplateComponent - Renamed
NonRepeatedTrackSizingFunctiontoTrackSizingFunction - The
Repeatvariant ofGridTemplateComponentnow contains a newGridTemplateRepetitionstruct, which allows line names to be specifed in addition to tracks. - The way that grid styles are exposed in the low-level API is now a lot more generic with many associated types.
GridTemplateAreastruct andStyle::grid_template_areasfieldStyle::grid_template_column_namesandStyle::grid_template_row_namesfields. If non-empty, these should have length of exactly one greater than the correspondinggrid_template_column/grid_template_rowsstyle.