1[package]
2name = "taffy"
3version = "0.9.1"
4authors = [
5 "Alice Cecile <alice.i.cecile@gmail.com>",
6 "Johnathan Kelley <jkelleyrtp@gmail.com>",
7 "Nico Burns <nico@nicoburns.com>",
8]
9edition = "2021"
10rust-version = "1.65"
11include = ["src/**/*", "examples/**/*", "Cargo.toml", "README.md"]
12description = "A flexible UI layout library "
13repository = "https://github.com/DioxusLabs/taffy"
14keywords = ["cross-platform", "layout", "flexbox", "css-grid", "grid"]
15categories = ["gui"]
16license = "MIT"
17
18[dependencies]
19arrayvec = { version = "0.7", default-features = false }
20document-features = { version = "0.2.7", optional = true }
21serde = { version = "1.0", default-features = false, optional = true, features = ["serde_derive"] }
22slotmap = { version = "1.0.6", default-features = false, optional = true }
23grid = { version = "1.0.0", default-features = false, optional = true }
24
25[package.metadata.docs.rs]
26# To test all the documentation related features, run:
27# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples --all-features --no-deps --open
28
29all-features = true
30# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
31cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
32rustdoc-args = ["--cfg", "docsrs"]
33
34[features]
35default = [
36 "std",
37 "taffy_tree",
38 "flexbox",
39 "grid",
40 "block_layout",
41 "float_layout",
42 "calc",
43 "content_size",
44 "detailed_layout_info",
45]
46#! ## Feature Flags
47#!
48#! ### Algorithms
49
50## Enables the Block layout algorithm. See [`compute_block_layout`](crate::compute_block_layout).
51block_layout = []
52## Enables the Float layout algorithm. This is a sub-feature of block layout.
53float_layout = []
54## Enables the Flexbox layout algorithm. See [`compute_flexbox_layout`](crate::compute_flexbox_layout).
55flexbox = []
56## Enables the CSS Grid layout algorithm. See [`compute_grid_layout`](crate::compute_grid_layout).
57grid = ["alloc", "dep:grid"]
58## Enables calc() values for all layout algorithms
59calc = []
60## Causes all algorithms to compute and output a content size for each node
61content_size = []
62## Causes algorithms to stores detailed information of the nodes in TaffyTree, with only CSS Grid supporting this.
63detailed_layout_info = []
64## Use strict provenance APIs for pointer manipulation. Using this feature requires Rust 1.84 or higher.
65strict_provenance = []
66
67#! ### Taffy Tree
68
69## Enable the built-in Taffy node tree. See [`TaffyTree`](crate::TaffyTree).
70taffy_tree = ["dep:slotmap"]
71
72#! ### Other
73
74## Add [`serde`] derives to Style structs
75serde = ["dep:serde"]
76## Allow Taffy to depend on the [`Rust Standard Library`](std)
77std = ["grid?/std", "serde?/std", "slotmap?/std"]
78## Allow Taffy to depend on the alloc library
79alloc = ["serde?/alloc"]
80## Internal feature for debugging
81debug = ["std"]
82## Internal feature for profiling
83profile = ["std"]
84
85[dev-dependencies]
86serde_json = "1.0.93"
87taffy_test_helpers = { path = "tests/common"}
88
89# Enable default features for tests and examples
90taffy = { path = "." }
91
92[profile.release]
93lto = true
94panic = 'abort'
95
96[[bench]]
97name = "dummy_benchmark"
98path = "benches/dummy_benchmark.rs"
99harness = false
100
101[[example]]
102name = "basic"
103# This causes all the examples to be scraped for documentation, not just the basic example
104doc-scrape-examples = true
105
106[workspace]
107members = [
108 "scripts/gentest",
109 "scripts/format-fixtures",
110 "scripts/import-yoga-tests",
111 "benches",
112 "tests/common",
113]
114# The cosmic_text example is excluded from the workspace as including it breaks compilation
115# of all crates in the workspace with our MSRV compiler
116exclude = ["examples/cosmic_text"]