Yoga is a cross-platform layout engine and embeddable core that determines the dimensions and offsets of hierarchical element trees. It provides a C++ implementation of the Flexbox layout model to calculate element positions and sizes based on web standards, ensuring a uniform appearance across diverse devices and operating systems.
The engine is designed for portability via a C API, allowing the layout logic to be integrated into various host languages and platforms. It utilizes an incremental layout system that identifies modified subtrees and recalculates positions only for changed nodes and their ancestors to avoid full tree recomputation.
The library covers a broad range of layout capabilities, including the application of box model styling with margins, padding, and borders. It resolves dimensions using absolute points or percentages and manages a tree-based hierarchy to propagate constraints and calculate relative positioning.