[Feature request] support vw&vh units #1097

Open
opened 2021-07-21 20:43:38 -07:00 by titanseason · 2 comments
titanseason commented 2021-07-21 20:43:38 -07:00 (Migrated from github.com)

Now yoga only support auto percent and point units,
Can add support for vw and vh units ?

Now `yoga` only support `auto` `percent` and `point` units, Can add support for `vw` and `vh` units ?
woehrl01 commented 2021-07-22 11:09:46 -07:00 (Migrated from github.com)

Hi @titanseason

That's a nice idea and should be fairly easy to implement. A few things need to be done to do that.

  1. Introduce the concept of a viewport. One way to do this is by extending YGConfig.
  2. Extend the API so that you can set this kind of values.
  3. Extend YGResolveValue to work with the values of the viewport to calculate the number.
  4. Write tests to evaluate correct behavior
  5. Check and adapt the algorithm, e.g. YGNodeIsStyleDimDefined and invalidation if the viewport changes.
Hi @titanseason That's a nice idea and should be fairly easy to implement. A few things need to be done to do that. 1. Introduce the concept of a viewport. One way to do this is by extending `YGConfig`. 2. Extend the API so that you can set this kind of values. 3. Extend `YGResolveValue` to work with the values of the viewport to calculate the number. 4. Write tests to evaluate correct behavior 5. Check and adapt the algorithm, e.g. `YGNodeIsStyleDimDefined` and invalidation if the viewport changes.
XantreDev commented 2023-02-21 07:27:37 -08:00 (Migrated from github.com)

Is it possible to do this without a deep dive into the project? Can I try to implement this?

Is it possible to do this without a deep dive into the project? Can I try to implement this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#1097
No description provided.