Files
taffy/Cargo.toml
T
Nico BurnsandGitHub 70341c9f69 Add support for parsing Taffy style types from string (#929)
* Fix typo in test_helper script

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Bump MSRV to 1.71

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Implement `FromStr` for style types

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Expose parsing error messages as strings

* Allow Unicode-3.0 license

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Parse keyword enums using cssparser

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2026-03-17 16:31:01 +00:00

123 lines
3.9 KiB
TOML

[package]
name = "taffy"
version = "0.9.2"
authors = [
"Alice Cecile <alice.i.cecile@gmail.com>",
"Johnathan Kelley <jkelleyrtp@gmail.com>",
"Nico Burns <nico@nicoburns.com>",
]
edition = "2021"
rust-version = "1.71"
include = ["src/**/*", "examples/**/*", "Cargo.toml", "README.md"]
description = "A flexible UI layout library "
repository = "https://github.com/DioxusLabs/taffy"
keywords = ["cross-platform", "layout", "flexbox", "css-grid", "grid"]
categories = ["gui"]
license = "MIT"
[dependencies]
arrayvec = { version = "0.7", default-features = false }
document-features = { version = "0.2.7", optional = true }
serde = { version = "1.0", default-features = false, optional = true, features = ["serde_derive"] }
slotmap = { version = "1.0.6", default-features = false, optional = true }
grid = { version = "1.0.0", default-features = false, optional = true }
cssparser = { version = "0.37.0", default-features = false, optional = true }
[package.metadata.docs.rs]
# To test all the documentation related features, run:
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples --all-features --no-deps --open
all-features = true
# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
rustdoc-args = ["--cfg", "docsrs"]
[features]
default = [
"std",
"taffy_tree",
"flexbox",
"grid",
"block_layout",
"float_layout",
"calc",
"content_size",
"detailed_layout_info",
"parse",
"parse_faster"
]
#! ## Feature Flags
#!
#! ### Algorithms
## Enables the Block layout algorithm. See [`compute_block_layout`](crate::compute_block_layout).
block_layout = []
## Enables the Float layout algorithm. This is a sub-feature of block layout.
float_layout = []
## Enables the Flexbox layout algorithm. See [`compute_flexbox_layout`](crate::compute_flexbox_layout).
flexbox = []
## Enables the CSS Grid layout algorithm. See [`compute_grid_layout`](crate::compute_grid_layout).
grid = ["alloc", "dep:grid"]
## Enables calc() values for all layout algorithms
calc = []
## Causes all algorithms to compute and output a content size for each node
content_size = []
## Causes algorithms to stores detailed information of the nodes in TaffyTree, with only CSS Grid supporting this.
detailed_layout_info = []
## Use strict provenance APIs for pointer manipulation. Using this feature requires Rust 1.84 or higher.
strict_provenance = []
#! ### Taffy Tree
## Enable the built-in Taffy node tree. See [`TaffyTree`](crate::TaffyTree).
taffy_tree = ["dep:slotmap"]
#! ### Other
## Add [`serde`] derives to Style structs
serde = ["dep:serde"]
## Implement `FromStr` trait for Taffy style types
parse = ["dep:cssparser"]
## Enable the `parse` feature with proc-macro dependent optimisations
parse_faster = ["parse", "cssparser/fast_match_byte"]
## Allow Taffy to depend on the [`Rust Standard Library`](std)
std = ["grid?/std", "serde?/std", "slotmap?/std"]
## Allow Taffy to depend on the alloc library
alloc = ["serde?/alloc"]
## Internal feature for debugging
debug = ["std"]
## Internal feature for profiling
profile = ["std"]
[dev-dependencies]
serde_json = "1.0.93"
taffy_test_helpers = { path = "tests/common"}
# Enable default features for tests and examples
taffy = { path = "." }
[profile.release]
lto = true
panic = 'abort'
[[bench]]
name = "dummy_benchmark"
path = "benches/dummy_benchmark.rs"
harness = false
[[example]]
name = "basic"
# This causes all the examples to be scraped for documentation, not just the basic example
doc-scrape-examples = true
[workspace]
members = [
"scripts/gentest",
"scripts/format-fixtures",
"scripts/import-yoga-tests",
"tests/common",
]
# The cosmic_text example and benches are excluded from the workspace as including them breaks compilation
# of all crates in the workspace with our MSRV compiler
exclude = ["examples/cosmic_text", "benches"]