Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Sep 22, 2023
1 parent 22b5d19 commit 2ac78c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ The layout type property determines how children of a node will be arranged. The
### Size
The size of a node is determined by its `width` and `height` properties. These properties are specified with `Units`, which has four variants:
- `Units::Pixels(val)` - Sets the size to a fixed number of pixels.

![](/docs/images/size_pixels.svg)

- `Units::Percentage(val)` - Sets the size to a percentage of the nodes parent size.

![](/docs/images/size_percentage.svg)

- `Units::Stretch(factor)` - Sets the size to a proportion of the free space of the parent within the same axis.

![](/docs/images/size_stretch.svg)

- `Units::Auto` - Sets the size to either hug the nodes children, or to inherit the [content size](#content-size) of the node.

![](/docs/images/size_auto.svg)

### Content Size
Expand All @@ -40,12 +47,19 @@ The position of a node within a stack can be adjusted by the spacing applied to

Spacing is specified with `Units`, which has four variants:
- `Units::Pixels(val)` - Sets the spacing to a fixed number of pixels.

![](/docs/images/space_pixels.svg)

- `Units::Percentage(val)` - Sets the spacing to a percentage of the nodes parent size.

![](/docs/images/space_percentage.svg)

- `Units::Stretch(factor)` - Sets the spacing to a proportion of the free space of the parent within the same axis.

![](/docs/images/space_stretch.svg)

- `Units::Auto` - Sets the spacing to inherit the [child spacing](#child-space) of the parent.

![](/docs/images/space_auto.svg)

### Position Type
Expand All @@ -66,6 +80,7 @@ The child space of a node applies space around its children by overriding the in
- `child_top` - The space that should be applied between the top side of the view and its children with individual `Auto` top spacing. Applies to all children in a horizontal stack and to the first child in a vertical stack.
![](/docs/images/child_top.svg)
- `child_bottom` - The space that should be applied between the bottom side of the view and its children with individual `Auto` bottom spacing. Applies to all children in a horizontal stack and to the first child in a vertical stack.

![](/docs/images/child_bottom.svg)

There are two additional child-spacing properties for setting the space between child nodes:
Expand Down

0 comments on commit 2ac78c1

Please sign in to comment.