Skip to content

Commit

Permalink
Support for align-content: space-evenly
Browse files Browse the repository at this point in the history
  • Loading branch information
OhKanghoon committed Jun 17, 2024
1 parent e8e098f commit 1eee514
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ Reminder: the cross axis is the axis perpendicular to the main axis. Its directi

### alignContent()
- Applies to: `flex containers`
- Values: `start` / `end` / `center` / `stretch` / `spaceBetween` / `spaceAround`
- Values: `start` / `end` / `center` / `stretch` / `spaceBetween` / `spaceAround` / `spaceEvenly`
- Default value: `start`
- CSS name: `align-content`

Expand All @@ -600,6 +600,7 @@ Note, `alignContent` has no effect when the flexbox has only a single line.
| **stretch** | <img src="docs_markdown/images/flexlayout-alignItems-column-stretch.png" width="140"/>| <img src="docs_markdown/images/flexlayout-alignItems-row-stretch.png" width="160"/>|
| **spaceBetween** | <img src="docs_markdown/images/flexlayout-alignItems-column-spaceBetween.png" width="160"/> | <img src="docs_markdown/images/flexlayout-alignItems-row-spaceBetween.png" width="160"/>|
| **spaceAround** | <img src="docs_markdown/images/flexlayout-alignItems-column-spaceAround.png" width="160"/> | <img src="docs_markdown/images/flexlayout-alignItems-row-spaceAround.png" width="160"/>|
| **spaceEvenly** | | |

<br/>

Expand Down
3 changes: 3 additions & 0 deletions Sources/Swift/FlexLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,9 @@ public final class Flex {
case spaceBetween
/// Lines are evenly distributed in the flex container, with half-size spaces on either end Play it »
case spaceAround
/// Lines are evenly distributed in the flex container
/// The size of gaps between children and between the parent's edges and the first/last child will all be equal
case spaceEvenly
}

/**
Expand Down
2 changes: 2 additions & 0 deletions Sources/Swift/Impl/FlexLayout+Enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extension YGAlign {
static let flexEnd = YGAlignFlexEnd
static let spaceBetween = YGAlignSpaceBetween
static let spaceAround = YGAlignSpaceAround
static let spaceEvenly = YGAlignSpaceEvenly
}

extension YGWrap {
Expand Down Expand Up @@ -106,6 +107,7 @@ extension Flex.AlignContent {
case .end: return YGAlign.flexEnd
case .spaceBetween: return YGAlign.spaceBetween
case .spaceAround: return YGAlign.spaceAround
case .spaceEvenly: return YGAlign.spaceEvenly
}
}
}
Expand Down

0 comments on commit 1eee514

Please sign in to comment.