From 1eee514a9251c0fc09d917ef0434f4295196626e Mon Sep 17 00:00:00 2001 From: OhKanghoon Date: Mon, 17 Jun 2024 18:04:44 +0900 Subject: [PATCH] Support for align-content: space-evenly --- README.md | 3 ++- Sources/Swift/FlexLayout.swift | 3 +++ Sources/Swift/Impl/FlexLayout+Enum.swift | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ad88dc..a7ff018 100644 --- a/README.md +++ b/README.md @@ -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` @@ -600,6 +600,7 @@ Note, `alignContent` has no effect when the flexbox has only a single line. | **stretch** | | | | **spaceBetween** | | | | **spaceAround** | | | +| **spaceEvenly** | | |
diff --git a/Sources/Swift/FlexLayout.swift b/Sources/Swift/FlexLayout.swift index ffcb949..bf8cf93 100644 --- a/Sources/Swift/FlexLayout.swift +++ b/Sources/Swift/FlexLayout.swift @@ -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 } /** diff --git a/Sources/Swift/Impl/FlexLayout+Enum.swift b/Sources/Swift/Impl/FlexLayout+Enum.swift index e6db952..ae2c68d 100644 --- a/Sources/Swift/Impl/FlexLayout+Enum.swift +++ b/Sources/Swift/Impl/FlexLayout+Enum.swift @@ -42,6 +42,7 @@ extension YGAlign { static let flexEnd = YGAlignFlexEnd static let spaceBetween = YGAlignSpaceBetween static let spaceAround = YGAlignSpaceAround + static let spaceEvenly = YGAlignSpaceEvenly } extension YGWrap { @@ -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 } } }