Skip to content

Commit 71027a8

Browse files
authored
Grid: Rename Flex to Fraction (#350)
* Rename Flex variant of MaxTrackSizingFunction to Fraction. Rename flex() helper to fr() * Add flex(N) helper function which is short for minmax(0, Nfr) * Update changelog * Regenerate tests after rebasing * Add evenly_sized_tracks style helper
1 parent f784137 commit 71027a8

File tree

60 files changed

+112
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+112
-89
lines changed

RELEASES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
## 0.3.0-alpha2 (unreleased)
44

5+
### Added
6+
7+
- A new style helper `evenly_sized_tracks(count: u16)` has been added which creates a grid template containing `count` evenly sized tracks (rows or columns)
8+
59
### Changed
610

711
- `experimental_grid` feature named to just `grid`
812
- `grid` feature enabled by default
913
- `GridPlacement::Line` now stores a `GridLine` newtype wrapper around an `i16` rather than a raw `i16`. If you are using the style helpers then this change will not affect you.
1014
- *BREAKING:* `Position` is now renamed to `Inset` and is now in line with [CSS inset specs](https://developer.mozilla.org/en-US/docs/Web/CSS/inset)
1115
- *BREAKING:* `PositionType` is now renamed to `Position` and is now in line with [CSS position specs](https://developer.mozilla.org/en-US/docs/Web/CSS/position)
16+
- `MaxTrackSizingFunction::Flex` is now called `MaxTrackSizingFunction::Fraction`. The `flex()` helper is now called `fr()`. A new `flex()` helper has been added which create a `minmax(0, Nfr)` track.
1217

1318
### Fixes
1419

benches/big_tree_grid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ fn random_grid_track<R: Rng>(rng: &mut R) -> TrackSizingFunction {
2020
} else if switch < 0.3 {
2121
max_content()
2222
} else if switch < 0.5 {
23-
flex(1.0)
23+
fr(1.0)
2424
} else if switch < 0.6 {
25-
minmax(points(0.0), flex(1.0))
25+
minmax(points(0.0), fr(1.0))
2626
} else if switch < 0.8 {
2727
points(40.0)
2828
} else {

benches/generated/grid_auto_takes_precedence_over_fr.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_fixed_size_no_content_proportions.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_fixed_size_no_content_proportions_sub_1_sum.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_fixed_size_single_item.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_no_sized_items_indefinite.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_single_item_indefinite.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_span_2_proportion.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/generated/grid_fr_span_2_proportion_sub_1_sum.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)