Support for min-content / max-content?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18.9k
- Forks
- 1.6k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Report
- I have searched existing issues and this is not a duplicate
Hi there, I'm working on a react-native layout that I can't seem to solve without using max-width: min-content, which doesn't seem to be supported in Yoga.
Have a look here:
http://jsfiddle.net/shmax/e3hud7xp/
The idea is that the blue and red text both occupy the parent space, and may not overflow it. The blue text is dominant and will win any argument over available real estate with the red text (so the red text will show ellipses, but the blue text won't unless it's wider than the overall space). The catch is that I have a value, p, which is the point along the width at which the red text will hold its ground; in other words, if there is not enough room for red and blue, and blue needs more than p percent of the available width, then both red and blue will truncate with ellipses at p.
I'm still trying to find alternate solutions, but so far the only thing I can get to work relies on that max-width: min-content you see in the .item style.
In the meantime, I thought I'd inquire about it here. I checked all the open and closed issues, and nobody has asked about either min-content or max-content, so maybe I'm missing something obvious.
Would a PR be welcome?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked JSFiddle and the .item style to understand the requested min-content behavior, then compare it with Yoga's current layout behavior. Done means Yoga supports the requested min-content/max-content sizing semantics and preserves the described truncation and space-allocation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, css, react-native
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100