Cargo Features

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

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

Algorithms

Enables the Block layout algorithm

flexbox default

Enables the Flexbox layout algorithm

Affects style::Style.flex_direction, style::Style.flex_wrap, style::Style.flex_basis, style::Style.flex_grow, style::Style.flex_shrink, 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

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, 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

Enables slotmap

serde

Other

Add serde derives to Style structs

Enables serde

std default debug? profile?

Allow Taffy to depend on the 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