Update FlexPanel default property values to match FlexBox specification #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
Some of the properties of
FlexPanel
have initial values that don't match the official specification ofFlexBox
.Specification
This caused default behavior of the
FlexPanel
to be inconsistent withFlexBox
behavior, which it is supposed to be emulating.Changes:
AlignItems
property:AlignItems.FlexStart
AlignItems.Stretch
AlignContents
property:AlignContent.FlexStart
AlignContent.Stretch
Wrap
property:FlexWrap.Wrap
FlexWrap.NoWrap
All new values were taken from the official
FlexBox
Specification.Impact:
This is a breaking change with respect to the default behavior of the
FlexPanel
and is likely to cause a disruption to current users updating to the new version.To fix any unwanted changes in behavior, each usage of
FlexPanel
would have to be checked and updates be made to overrule the new default property values with the old ones.Since this would be quite a tedious process, the following styles are provided as an alternative to revert the initial values to what they were before this PR.
While this change will cause disruption in the short term, it should prove a benefit in the long run.
This is specifically useful to developers adapting UI designs into Avalonia from HTML/CSS based sources, like Figma or other deign tools or existing UIs.
Having different defaults from
FlexBox
results in confusion and frustrations for the developers.Since the whole point of this
Avalonia.Labs
repository is to host controls and panels that are not API stable, it feels important to make this kind of changes now.