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 18e62d8 commit 5c8d780
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ 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.
- `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,15 +44,16 @@ 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)

![](/docs/images/space_pixels.svg)
- `Units::Percentage(val)` - Sets the spacing to a percentage of the nodes parent size.
![](/docs/images/space_percentage.svg)

![](/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)

![](/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 @@ -63,15 +68,16 @@ Self directed nodes do not contribute to the size of the parent when the parent
### Child Space
The child space of a node applies space around its children by overriding the individual auto spacing of the nodes children and is also specified with `Units`.
- `child_left` - The space that should be applied between the left side of the view and its children with individual `Auto` left spacing. Applies to all children in a vertical stack and to the first child in a horizontal stack.
![](/docs/images/child_left.svg)

![](/docs/images/child_left.svg)
- `child_right` - The space that should be applied between the right side of the view and its children with individual `Auto` right spacing. Applies to all children in a vertical stack and to the first child in a horizontal stack.
![](/docs/images/child_right.svg)

![](/docs/images/child_right.svg)
- `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)

![](/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 5c8d780

Please sign in to comment.