Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexbox layout #257

Merged
merged 13 commits into from
Dec 5, 2021
Merged

Flexbox layout #257

merged 13 commits into from
Dec 5, 2021

Conversation

mikke89
Copy link
Owner

@mikke89 mikke89 commented Nov 20, 2021

It's been some time in the making now. This has perhaps been the most requested feature yet (see #182), so I'm happy to present this. Finally display: flex is ready for a wider audience!

In case you want to read up on what flexbox layout is, see eg. flexbox layout at MDN for an introduction.

I've generally followed the CSS specification, although there are some minor differences. Not everything makes sense for RmlUi, and there are some details I've dropped for the sake of simplicity.

I encourage everyone to test and report back. I'm especially eager to rule out bugs in real world usage. Or just to see you guys have fun with it, screenshots are appreciated!

See the WIP flexbox documentation. It lists all the related properties and differences from CSS. It still needs a more detailed description of the properties, but you will get far with looking at CSS guides. There are also several examples in the Visual Tests sample.

Screenshots

flex_layout

flex_modes_horizontal

Known limitation

  • display: flex doesn't currently work properly on elements that are absolutely positioned or floated. This is the same situation as for tables, instead please wrap the flex container inside another div.

I also need to clean up the commit history quite a bit.

@mikke89 mikke89 added enhancement New feature or request layout Layout engine issues and enhancements labels Nov 20, 2021
- WIP Start working on flexbox layouting
- WIP basic flex layouting
- Flexbox algorithm, resolving flexible lengths of items
- Flexbox cross sizing
- Fix flexbox cross size
- Flexbox main axis alignment
- Flexbox cross-axis alignment. With that, flexboxes are feature complete but needs cleanup, much more testing, and lots of fixes.
- Flexbox warning instead of error
- Add visual test for 'flex-direction'
- Support for reverse flow direction and reverse wrap
- Flexbox wrap on exceeded main max size
- Fix auto margins on flex items along cross axis, and wrap reverse should also reverse cross offset within a line
- Update and add new flexbox visual test
- Fix flexbox reverse offseting
- Support absolutely positioned items within flex container
- Update flexbox visual test
- Fix flexbox overflow sizing
- Update flexbox visual tests
- Flexbox baseline alignment
- Add flexbox scrollbar sample
- Add support for scrollbars in flex container
- Fix some compiler warnings
- Update and add new flexbox visual tests
- Cleanup flexbox layout and use common methods with table
- Flex layout use formatting context mode for LayoutDetails::BuildBox, fix final todos from flexbox layout
- Format flex layout
- Fix pixel rounding issues in flexbox layout
- Small fix for flex layout pixel rounding
- Flex layout avoid 0/0 float math
- Update flex visual sample
- Flex layout: Set a definite width when finding the vertical content size.
- Update flex sample with animation
- Add visual test for flex container height constraints
- Flex container now respects min-/max- constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request layout Layout engine issues and enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant