bevy/crates
Nico Burns 363d0f0c7c
Add CSS Grid support to bevy_ui (#8026)
# Objective

An easy way to create 2D grid layouts

## Solution

Enable the `grid` feature in Taffy and add new style types for defining
grids.

## Notes

- ~I'm having a bit of trouble getting `#[derive(Reflect)]` to work
properly. Help with that would be appreciated (EDIT: got it to compile
by ignoring the problematic fields, but this presumably can't be
merged).~ This is now fixed
- ~The alignment types now have a `Normal` variant because I couldn't
get reflect to work with `Option`.~ I've decided to stick with the
flattened variant, as it saves a level of wrapping when authoring
styles. But I've renamed the variants from `Normal` to `Default`.
- ~This currently exposes a simplified API on top of grid. In particular
the following is not currently supported:~
   - ~Negative grid indices~ Now supported.
- ~Custom `end` values for grid placement (you can only use `start` and
`span`)~ Now supported
- ~`minmax()` track sizing functions~ minmax is now support through a
`GridTrack::minmax()` constructor
   - ~`repeat()`~ repeat is now implemented as `RepeatedGridTrack`

- ~Documentation still needs to be improved.~ An initial pass over the
documentation has been completed.

## Screenshot

<img width="846" alt="Screenshot 2023-03-10 at 17 56 21"
src="https://user-images.githubusercontent.com/1007307/224435332-69aa9eac-123d-4856-b75d-5449d3f1d426.png">

---

## Changelog

- Support for CSS Grid layout added to `bevy_ui`

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>
2023-04-17 16:21:38 +00:00
..
bevy_a11y Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_animation Improved AnimationPlugin declaration. (#8361) 2023-04-12 19:27:38 +00:00
bevy_app Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_asset Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_audio Ability to set a Global Volume (#7706) 2023-04-10 14:08:43 +00:00
bevy_core Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_core_pipeline Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_diagnostic Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_ecs Simplify system piping and make it more flexible (#8377) 2023-04-17 16:08:32 +00:00
bevy_ecs_compile_fail_tests Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_encase_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gilrs Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gizmos Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gltf Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_hierarchy Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_input Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_internal add a feature for memory tracing with tracy (#8272) 2023-04-17 16:04:46 +00:00
bevy_log add a feature for memory tracing with tracy (#8272) 2023-04-17 16:04:46 +00:00
bevy_macro_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_math Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_mikktspace Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_pbr Fix pbr shader breaking on missing UVs (#8412) 2023-04-17 06:22:34 +00:00
bevy_ptr Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_reflect Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Fix trailing comma breaking derives (#8014) 2023-03-27 21:47:33 +00:00
bevy_render Fix get_vertex_buffer_data doc (#8400) 2023-04-17 16:12:12 +00:00
bevy_scene Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_sprite Better error message when index does not exist in texture atlas (#8396) 2023-04-17 16:10:58 +00:00
bevy_tasks Cleaned up panic messages (#8219) 2023-04-12 18:27:28 +00:00
bevy_text text_system split (#7779) 2023-04-17 15:23:21 +00:00
bevy_time Add a scope API for world schedules (#8387) 2023-04-16 05:09:33 +00:00
bevy_transform Fix transform propagation of orphaned entities (#7264) 2023-04-09 20:53:33 +00:00
bevy_ui Add CSS Grid support to bevy_ui (#8026) 2023-04-17 16:21:38 +00:00
bevy_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_window Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_winit Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00