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

Implement Percentage support for gap styles #1643

Closed
wants to merge 1 commit into from

Conversation

realsoelynn
Copy link
Contributor

Summary:
Changelog [Internal]:

  • Added percentage value for flex layout gap
  • Wired up to pass proper available width and height to implement this feature

Differential Revision: D56002340

Copy link

vercel bot commented Apr 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 8:40pm

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 12, 2024
Summary:

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Apr 12, 2024
Summary:
X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/yoga that referenced this pull request Apr 12, 2024
Summary:
X-link: facebook/litho#980


Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Apr 13, 2024
Summary:

X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 13, 2024
Summary:
X-link: facebook/react-native#44067


X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/yoga that referenced this pull request Apr 13, 2024
Summary:
X-link: facebook/react-native#44067

X-link: facebook/litho#980


Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

@nicoburns
Copy link
Contributor

We have some tests for this in Taffy's test suite (search for gap_percentage here: https://github.com/DioxusLabs/taffy/tree/main/test_fixtures/flex). In particular you may want to add tests for the case where the container's size isn't a fixed size, which can require re-resolving the gap size once the container size is computed.

realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Apr 15, 2024
Summary:

X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/yoga that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067

X-link: facebook/litho#980


Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067


X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

@realsoelynn
Copy link
Contributor Author

We have some tests for this in Taffy's test suite (search for gap_percentage here: https://github.com/DioxusLabs/taffy/tree/main/test_fixtures/flex). In particular you may want to add tests for the case where the container's size isn't a fixed size, which can require re-resolving the gap size once the container size is computed.

Thank you so much for the feedback on this. I am looking at how to improve our test cases as well as visualization aspect of it.

realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Apr 15, 2024
Summary:

X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/yoga that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067

X-link: facebook/litho#980


Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067


X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

Summary:
X-link: facebook/react-native#44067

X-link: facebook/litho#980


Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
Comment on lines +223 to +233
<div id="row_gap_percent_wrapping_with_flexible_content" style="flex-direction: row; width: 300px; height: 300px; gap: 10%;">
<div style="flex: 1;"></div>
<div style="flex: 1;"></div>
<div style="flex: 1;"></div>
</div>

<div id="row_gap_percent_wrapping_with_mixed_flexible_content" style="flex-direction: row; width: 300px; height: 300px; gap: 10%;">
<div style="width: 10px;"></div>
<div style="flex: 1;"></div>
<div style="width: 10%;"></div>
</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoburns Thanks for the test case suggestion.

realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Apr 15, 2024
Summary:

X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067


X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56002340

realsoelynn added a commit to realsoelynn/litho that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067


X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in cd4a1b8.

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Apr 15, 2024
Summary:
X-link: facebook/react-native#44067

Pull Request resolved: #980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340

fbshipit-source-id: c0bc86ac70a1391f115c87da99c2ef411535f68b
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 15, 2024
Summary:
Pull Request resolved: #44067

X-link: facebook/litho#980

X-link: facebook/yoga#1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340

fbshipit-source-id: c0bc86ac70a1391f115c87da99c2ef411535f68b
@realsoelynn realsoelynn deleted the export-D56002340 branch April 29, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants