# Size and space

**Boxes stretch with the screen; text and gaps stay the same.**

`size: width, height` is out of 100 of the parent: width against the parent's width, height
against the parent's height. One number makes a square from the parent's width.

| Value | Means |
|---|---|
| `size: 50, 20` | half as wide as the parent, a fifth as tall |
| `size: 30` | a square, 30 % of the parent's width on each side |
| `size: max, auto` | fill the width, as tall as the content |
| `max` | fill the room that is left |
| `auto` | fit the content (the default) |

Space is in fixed points, the same on every phone:

| Attribute | The space… |
|---|---|
| `space_inside` | inside the container, around its children (padding) |
| `space_between` | between the children |
| `space_around` | outside the container (margin) |

The difference between `space_inside` and `space_around` is which side of the edge the space is on.
`space_inside` is part of the container: its colour, image and tap area fill it, and it pushes the
children away from the edge. `space_around` is outside: the parent shows through, and it pushes the
container away from its neighbours and its parent's edge.

One number is every side. Name the sides for different ones, in any combination:
`space_inside: 16, top 32` or `space_inside: left right 20, top bottom 8`.

```vi
main page:
  space_inside: 24, top 48
  space_between: 12
  children:
    box_a:
      size: max, 20
      color: amber[300]
    box_b:
      size: 50, 20
      color: amber[500]
      space_around: left 40
    box_c:
      size: 25
      color: amber[700]
```
