Skip to content

Commit

Permalink
Add support for align-items: space-evenly (DioxusLabs#218)
Browse files Browse the repository at this point in the history
* Add support for align-items: space-evenly

* Add AlignContent::SpaceEvenly to RELEASES.md

* Fix typo in AlignContent doc comments (gap -> gaps)

Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>

* Fix align_content_space_around_single_line test

Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>
  • Loading branch information
nicoburns and Weibye committed Aug 23, 2022
1 parent f8e2814 commit 16dc3c6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ pub enum AlignContent {
/// The gap between items is distributed evenly.
SpaceBetween,
/// The gap between the first and last items is exactly THE SAME as the gap between items.
/// The gap are distributed evenly
/// The gaps are distributed evenly
SpaceEvenly,
/// The gap between the first and last items is exactly HALF the gap between items.
/// The gap are distributed evenly in proportion to these ratios.
/// The gaps are distributed evenly in proportion to these ratios.
SpaceAround,
}

Expand Down Expand Up @@ -214,13 +214,13 @@ pub enum JustifyContent {
/// Items are packed along the center of the main axis
Center,
/// The first and last items are aligned flush with the edges of the container (no gap)
/// The gap between items is distributed evenly.
/// The gaps between items are distributed evenly.
SpaceBetween,
/// The gap between the first and last items is exactly THE SAME as the gap between items.
/// The gap are distributed evenly
/// The gaps are distributed evenly
SpaceEvenly,
/// The gap between the first and last items is exactly HALF the gap between items.
/// The gap are distributed evenly in proportion to these ratios.
/// The gaps are distributed evenly in proportion to these ratios.
SpaceAround,
}

Expand Down
2 changes: 1 addition & 1 deletion test_fixtures/align_content_space_around_single_line.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<head/>
<body>

<div id="test-root" style="width: 100px; height: 100px; flex-direction: row; flex-wrap: wrap; align-content: space-around;">
<div id="test-root" style="width: 100px; height: 100px; flex-direction: row; align-content: space-around;">
<div style="height: 10px; width: 50px"></div>
<div style="height: 10px; width: 50px"></div>
<div style="height: 10px; width: 50px"></div>
Expand Down
33 changes: 16 additions & 17 deletions tests/generated/align_content_space_around_single_line.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16dc3c6

Please sign in to comment.