Releases: DioxusLabs/taffy
v0.10.0
The MSRV for this release is 1.71.
Support for direction
The direction property is now supported, allowing for RTL layout of boxes in Block, Flexbox, and CSS Grid layout modes.
Support for floats
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.
Support for parsing styles from CSS string (#929)
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.
Changed
- 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)
Fixed
- Flexbox: apply gap even when there are auto margins (#938)
v0.9.2
v0.9.1
v0.9.0
Support for named grid lines and grid areas
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.
Changed
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.
Added
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.
v0.8.3
v0.8.2
v0.8.1
v0.8.0
Highlights
The big feature in this release is support for calc() values in the low-level API.
To use this API:
- Implement the
resolve_calc_valuemethod when implementing theLayoutPartialTreetrait. - Pass a type-erased pointer (
*const ()) to constructors likeLengthPercentage::calc(...)
Taffy treats the pointer as an opaque value (excepting that it uses the low 3 bits as a tag) which it will
pass to LayoutPartialTree::resolve_calc_value along with a percentage resolution basis when it needs to
resolve the value.
Changed
- The representation of many "size" types is now a tagged pointer than an enum. This is to enable
calc().
The effected types areLengthPercentage,LengthPercentageAuto,Dimension,MinTrackSizingFunction, and
MaxTrackSizingFunctiontypes.
Added
- Special-case "compressible replaced elements" in grid sizing algorithm (#807)
This allows for more correct sizing of "replaced" elements such as images that are children
of flexbox or grid containers.