bevy_ecss icon indicating copy to clipboard operation
bevy_ecss copied to clipboard

Extend `overflow` property

Open Rynibami opened this issue 3 years ago • 1 comments

The current implementation of the overflow property follows the grammar overflow: [visible | hidden]; which is awesome, but I lack the scroll-like values. The css documentation of the W3C describes that the overflow property may have the following values:

  • visible - Default. The overflow is not clipped. The content renders outside the element's box.
  • hidden - The overflow is clipped, and the rest of the content will be invisible.
  • scroll - The overflow is clipped, and a scrollbar is added to see the rest of the content.
  • auto - Similar to scroll, but it adds scrollbars only when necessary.

In addition to this extension, I would like to suggest to add the overflow-x and overflow-y as well for ease of use.

Rynibami avatar Oct 10 '22 12:10 Rynibami

The overflow property within this crate maps to the bevy::ui::Overflow enum in bevy.

Unless BevyUI intends on getting as close to web UI as it can (which may not be sensible) the best solution may be to create your own ScrollableBundle to attach to an entity in the UI. You can then customise the rendering of your children and scrollbar as best fits the project.

TheBeardedQuack avatar Apr 12 '23 20:04 TheBeardedQuack