Skip to content

Support align-content: space-evenly #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- FlexLayout (2.0.8)
- FlexLayout (2.0.9)
- PinLayout (1.10.5)
- SwiftLint (0.55.1)

Expand All @@ -18,7 +18,7 @@ EXTERNAL SOURCES:
:path: "./"

SPEC CHECKSUMS:
FlexLayout: 74c80db7698ea6e0d11e00ba012c0b9f3252938a
FlexLayout: 6904d99efeb7279cb218d10f40a71c4690445ada
PinLayout: f6c2b63a5a5b24864064e1d15c67de41b4e74748
SwiftLint: 3fe909719babe5537c552ee8181c0031392be933

Expand Down
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
Loading