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

Flex shorthand in UseWebDefaults should set basis to 0 instead of auto #1523

Open
NickGerleman opened this issue Dec 16, 2023 · 3 comments
Open

Comments

@NickGerleman
Copy link
Contributor

Since UseWebDefaults was added with 62f4719,

return node->config->useWebDefaults ? &YGValueAuto : &YGValueZero;

https://www.w3.org/TR/css-flexbox-1/#flex-common says that zeroing is the right interpretation, so UseWebDefaults does the wrong thing seemingly.

@NickGerleman
Copy link
Contributor Author

UseWebDefaults is going to be in a weird place in general with static and block in the mix.

@nicoburns
Copy link
Contributor

What is the value in Yoga supporting the shorthand syntax? Why not just stick to the longhand syntax and let the layers above Yoga lower the shorthand into the longhand?

@NickGerleman
Copy link
Contributor Author

It’s a good question.

Yogas api has historically supported length shorthands through different “edges”, e.g. all vs horizontal vs left. It will then resolve based on specificity.

That’s convenient in not letting the underlying framework need to manage extra state, and the resolved value can depend on things like ltr vs rtl, but if means Yoga must store the information (probably more efficiently than the host would too).

Beyond what we’d do with a clean slate though, I’ve been aiming to avoid non-trivial breaks to the public api (though I introduced plenty of more trivial ones for the next release).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants