flexbox_gap/
flexbox_gap.rs1use takia::prelude::*;
2
3fn main() -> Result<(), takia::TakiaError> {
7 let mut takia: TakiaTree<()> = TakiaTree::new();
8
9 let child_style = Style { size: Size { width: length(20.0), height: length(20.0) }, ..Default::default() };
10 let child0 = takia.new_leaf(child_style.clone())?;
11 let child1 = takia.new_leaf(child_style.clone())?;
12 let child2 = takia.new_leaf(child_style.clone())?;
13
14 let root = takia.new_with_children(
15 Style { gap: Size { width: length(10.0), height: zero() }, ..Default::default() },
16 &[child0, child1, child2],
17 )?;
18
19 takia.compute_layout(root, Size::MAX_CONTENT)?;
21 takia.print_tree(root);
22
23 Ok(())
24}