Cargo Features

[dependencies]
taffy = { version = "0.7.0", default-features = false, features = ["block_layout", "flexbox", "grid", "content_size", "taffy_tree", "serde", "std", "alloc", "debug", "profile", "document-features"] }
default = block_layout, content_size, flexbox, grid, std, taffy_tree

These default features are set whenever taffy is added without default-features = false somewhere in the dependency tree.

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_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, style::Style.align_content, style::Style.justify_content, style::Style.gap

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

taffy_tree default

Taffy Tree

Enable the built-in Taffy node tree. See TaffyTree.

Enables slotmap

serde

Other

Add serde derives to Style structs

Enables serde

std default debug? profile?

Allow Taffy to depend on the Rust Standard Library

Enables std of optional grid, num-traits, optional serde, and optional slotmap

alloc grid

Allow Taffy to depend on the alloc library

Enables alloc of optional serde

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