Cargo Features
[dependencies]
taffy = { version = "0.9.2", default-features = false, features = ["block_layout", "flexbox", "grid", "calc", "content_size", "detailed_layout_info", "strict_provenance", "taffy_tree", "serde", "std", "alloc", "debug", "profile", "document-features"] }
- default = block_layout, calc, content_size, detailed_layout_info, flexbox, grid, std, taffy_tree
-
These default features are set whenever
taffyis added withoutsomewhere in the dependency tree.default-features = false - block_layout default
-
Feature Flags
Algorithms
Enables the Block layout algorithm. See
compute_block_layout.Affects
style::Style.text_align,traits::LayoutBlockContainer… - flexbox default
-
Enables the Flexbox layout algorithm. See
compute_flexbox_layout.Affects
style::Style.flex_direction,style::Style.flex_wrap,style::Style.flex_basis,style::Style.flex_grow,style::Style.flex_shrink,traits::LayoutFlexboxContainer,style::Style.align_items,style::Style.align_self,style::Style.align_content,style::Style.justify_content,style::Style.gap… - grid default = alloc
-
Enables the CSS Grid layout algorithm. See
compute_grid_layout.Enables grid
Affects
style::Style.justify_items,style::Style.justify_self,style::Style.grid_template_rows,style::Style.grid_template_columns,style::Style.grid_auto_rows,style::Style.grid_auto_columns,style::Style.grid_auto_flow,style::Style.grid_template_areas,style::Style.grid_template_column_names,style::Style.grid_template_row_names,style::Style.grid_row,style::Style.grid_column,style_helpers::repeat,style_helpers::evenly_sized_tracks,style_helpers::minmax,style_helpers::flex,style_helpers::fr,traits::LayoutGridContainer,style::Style.align_items,style::Style.align_self… - calc default
-
Enables calc() values for all layout algorithms
- content_size default
-
Causes all algorithms to compute and output a content size for each node
Affects
layout::LayoutOutput.content_size,layout::Layout.content_size… - detailed_layout_info default
-
Causes algorithms to stores detailed information of the nodes in TaffyTree, with only CSS Grid supporting this.
Affects
grid::DetailedGridInfo,grid::DetailedGridTracksInfo,grid::DetailedGridItemsInfo,compute::detailed_info,layout::DetailedLayoutInfo,traits::LayoutGridContainer.set_detailed_grid_info… - strict_provenance
-
Use strict provenance APIs for pointer manipulation. Using this feature requires Rust 1.84 or higher.
- taffy_tree default
-
Taffy Tree
Enable the built-in Taffy node tree. See
TaffyTree.Enables slotmap
- serde
-
Other
Add
serdederives to Style structsEnables serde
- std default debug? profile?
-
Allow Taffy to depend on the
Rust Standard LibraryEnables std of optional grid, optional serde, and optional slotmap
Affects
style::CheapCloneStr… - alloc grid
-
Allow Taffy to depend on the alloc library
Enables alloc of optional serde
Affects
style::CheapCloneStr… - debug = std
-
Internal feature for debugging
Affects
debug::DebugLogger… - profile = std
-
Internal feature for profiling
Affects
debug::DebugLogger…
Features from optional dependencies
- document-features implicit feature
-
Enables document-features
document-features:
Extract documentation for the feature flags from comments in Cargo.toml