Yoga is a cross-platform layout engine which implements Flexbox.

Related tags

Layout yoga
Overview

Yoga CocoaPods npm bintray NuGet

Building

Yoga builds with buck. Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.

Testing

For testing we rely on gtest as a submodule. After cloning Yoga run git submodule init followed by git submodule update.

For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the tests directory. Run the tests by executing buck test //:yoga.

Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run gentest/gentest.rb to generate a test for you. You can write html which you want to verify in Yoga, in gentest/fixtures folder, such as the following.

">
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
  <div style="width: 50px; height: 50px;">div>
div>

Run gentest/gentest.rb to generate test code and re-run buck test //:yoga to validate the behavior. One test case will be generated for every root div in the input html.

You may need to install the latest watir-webdriver gem (gem install watir-webdriver) and ChromeDriver to run gentest/gentest.rb Ruby script.

.NET

.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, csharp/tests/Facebook.Yoga/test_macos.sh.

Benchmarks

Benchmarks are located in benchmark/YGBenchmark.c and can be run with buck run //benchmark:benchmark. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.

JavaScript

Installing through NPM

npm install yoga-layout

By default this will install the library and try to build for all platforms (node, browser asm, and standalone webpack). You may receive errors if you do not have the required platform development tools already installed. To preset the platform you'd like to build for you can set a .npmrc property first.

npm config set yoga-layout:platform standalone

This will now only run the standalone webpack build upon install.

Build Platforms

name description
all (default) Builds all of these platforms.
browser Builds asm js browser version.
node Builds node js version.
standalone Runs webpack.
none Does nothing. You can use the prepackaged libs.

Maintainer Release Guide

To publish a new release, follow these steps:

  1. Ensure you have your GPG key set up and your OSS Sonatype credentials handy.
  2. Add the follow entries to either your local gradle.properties (don't forget to revert) or your global ~/.gradle/gradle.properties:
# You get these from https://oss.sonatype.org/#profile;User%20Token
mavenCentralRepositoryUsername=
   
    
mavenCentralRepositoryPassword=
    
     

# You can get the keyId (in GPG 1.4 format) by running `gpg1 --list-keys`.
signing.secretKeyRingFile=
signing.keyId=
     
      
signing.password=
      

      
     
    
   
  1. Change the VERSION_NAME in gradle.properties to a non-SNAPSHOT release.
  2. Commit and land the version change.
  3. Run ./gradlew publishToMaven.
  4. Run ./gradlew closeAndReleaseRepository.
  5. Change the VERSION_NAME in gradle.properties back to a new SNAPSHOT release.
  6. Commit and land the version change.
  7. Celebrate! You've made a release!
Comments
  • Add feature to use percentage as value unit

    Add feature to use percentage as value unit

    Adds the feature to use percentage as a value unit.

    You can use the function YGPx(float) and YGPercent(float) for convenience.

    I did some benchmarks:

    Without Percentage Feature - Release x86:
    
    Stack with flex: median: 0.000000 ms, stddev: 0.146683 ms
    Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
    Nested flex: median: 0.000000 ms, stddev: 0.490101 ms
    Huge nested layout: median: 23.000000 ms, stddev: 0.928291 ms
    
    Stack with flex: median: 0.000000 ms, stddev: 0.170587 ms
    Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.143384 ms
    Nested flex: median: 0.000000 ms, stddev: 0.477791 ms
    Huge nested layout: median: 22.000000 ms, stddev: 2.129779 ms
    
    
    With Percentage Feature - Release x86:
    
    Stack with flex: median: 0.000000 ms, stddev: 0.132951 ms
    Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
    Nested flex: median: 0.000000 ms, stddev: 0.489570 ms
    Huge nested layout: median: 21.000000 ms, stddev: 1.390476 ms
    
    Stack with flex: median: 0.000000 ms, stddev: 0.146969 ms
    Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.129271 ms
    Nested flex: median: 0.000000 ms, stddev: 0.481787 ms
    Huge nested layout: median: 21.000000 ms, stddev: 1.695898 ms
    

    It is slightly faster, as I was able to reduce the calls to isnan().

    CLA Signed 
    opened by woehrl01 97
  • Adds Javascript Support

    Adds Javascript Support

    • As mentioned in the title, this PR adds Javascript support to Yoga. Two different builds are included in this PR thanks to nbind, which conveniently allow to target both Node.js' native addons and browser environments via asmjs with approximately the same codebase. That should solve #215.

    • All tests successfully pass on both codepaths. You can run yarn test:all inside the javascript directory to test it.

    • Because of a bug in nbind, the following PR needs to be merged and a new version released before this one can be safely merged as well.

    • I had to use double types instead of float in the C++ bindings because of an Emscripten bug where symbols aren't correctly exported when using floats.

    • There's some tweaks to do before this PR is 100% ready to merge, but I wanted to have your opinion first. What do you think of this?


    To do:

    • [x] Ensure that Travis run
    • [x] Add missing functions
    • [x] Check measurement functions
    • [x] Recursive frees
    • [x] Make a decision about the memory management
    CLA Signed 
    opened by arcanis 74
  • Update C# wrapper to support both desktop and UWP projects...

    Update C# wrapper to support both desktop and UWP projects...

    The C# wrapper project has been changed to a NETStandard (1.1) PCL allowing it to be consumed by any project targeting .NET4.5 or greater including .NETCore and UWP projects... The C# wrapper uses P/Invoke to call into the Native Yoga DLL...

    The "Yoga" C++ project has been updated to support ARM builds...

    Added the ability to generate nuget packages for the C# wrapper that supports copying the native DLLs to the target output directory.

    CLA Signed 
    opened by pre10der89 57
  • Add Carthage & CocoaPods support.

    Add Carthage & CocoaPods support.

    This supersedes #309 and #305.

    This is still a work-in-progress.

    TODO

    • [x] Create Xcode project that builds an iOS framework
    • [x] Fix failing tests on Xcode
    • [x] Make pod lib lint pass and make sure YogaKit can be included using CocoaPods
    • [ ] Add pod lib lint to .travis.yml
    • [x] Migrate to travis osx image with Xcode 8.2

    FOLLOW-UP

    • [ ] Make YogaKitSample use framework built by new Xcode project.
    • [ ] Make Travis to upload prebuilt versions of the framework. More here
    • [ ] Upgrade github/jekyll docs about installation using Cocoapods/Carthage
    CLA Signed 
    opened by guidomb 54
  • WIP: Improve the Objective-C and Swift bridge

    WIP: Improve the Objective-C and Swift bridge

    What I've done

    Here is what I've done so far:

    • I created a framework target in the Xcode project to support Carthage
    • I renamed the prefix from YG to YK to support custom enums
    • I modified the enums.py generator to add a generation of Objective-C enums
      • I removed enums which were not used in the Objective-C bridge
      • I made sure not to generate the Count items
      • I renamed LTR and RTL to LeftToRight and RightToLeft :-) we don't mind being verbose if it makes identifiers clearer
    • I transformed the style setters into properties and added the getter methods
    • I renamed the swift names to drop the prefix, which is not Swift style.

    For example, here are what the Objective-C and Swift sample code look like:

    Objective-C

    - (void)viewDidLoad
    {
        UIView *root = self.view;
        root.backgroundColor = [UIColor redColor];
        [root yk_setUsesYoga:YES];
        [root yk_setWidth:self.view.bounds.size.width];
        [root yk_setHeight:self.view.bounds.size.height];
        [root yk_setAlignItems:YKAlignCenter];
        [root yk_setJustifyContent:YKJustifyCenter];
    
        UIView *child1 = [UIView new];
        child1.backgroundColor = [UIColor blueColor];
        [child1 yk_setUsesYoga:YES];
        [child1 yk_setWidth:100];
        [child1 yk_setHeight:100];
    
        UIView *child2 = [UIView new];
        child2.backgroundColor = [UIColor greenColor];
        child2.frame = (CGRect) {
            .size = {
                .width = 200,
                .height = 100,
            }
        };
    
        UIView *child3 = [UIView new];
        child3.backgroundColor = [UIColor yellowColor];
        child3.frame = (CGRect) {
            .size = {
                .width = 100,
                .height = 100,
            }
        };
    
        [child2 addSubview:child3];
        [root addSubview:child1];
        [root addSubview:child2];
        [root yk_applyLayout];
    }
    

    Swift

        override func viewDidLoad() {
            let root = view!
            root.backgroundColor = .red
            root.usesYoga = true
            root.layoutWidth = view.bounds.size.width
            root.layoutHeight = view.bounds.size.height
            root.layoutAlignItems = .center
            root.layoutJustifyContent = .center
          
            let child1 = UIView()
            child1.backgroundColor = .blue
            child1.usesYoga = true
            child1.layoutWidth = 100
            child1.layoutHeight = 100
          
            let child2 = UIView()
            child2.backgroundColor = .green
            child2.frame = CGRect(origin: .zero, size: CGSize(width: 200, height: 100))
          
            let child3 = UIView()
            child3.backgroundColor = .yellow
            child3.frame = CGRect(origin: .zero, size: CGSize(width: 100, height: 100))
          
            child2.addSubview(child3)
            root.addSubview(child1)
            root.addSubview(child2)
            root.applyLayout()
        }
    

    Here's what I'd still like to do, but not sure on how best to achieve:

    YKEdge based style values

    I have purposefully left the style values which depend on an YKEdge alone because I'd like to improve them to be properties, but I'm undecided on how to. Here are my two solutions:

    Normalization

    We could create yk_positionLeft, yk_positionRight, etc... properties. The pro is that it's simple and efficient, but it's a bit messy.

    Sub-types

    Or we could go through sub-types with left, `right, etc.. properties:

    @interface YKPosition
    @property (nonatomic) CGFloat left;
    @property (nonatomic) CGFloat top;
    @property (nonatomic) CGFloat right;
    @property (nonatomic) CGFloat bottom;
    @property (nonatomic) CGFloat start;
    @property (nonatomic) CGFloat end;
    @property (nonatomic) CGFloat horizontal;
    @property (nonatomic) CGFloat vertical;
    @property (nonatomic) CGFloat all;
    @end
    

    Getting and setting such a property would look like this:

    view.yk_position.left = 20;
    

    This would be the cleanest solution. But it forces us to initialise three extra objects per view. We could however restrict this solution to Swift and use a struct, which would reduce the performance cost.

    Prefix in Swift

    I removed the yk_ prefix in Swift because its an anti-pattern and replaced it with layout. The first question is: would it be better if it were yoga instead?

    Whatever it is, I think we still need some kind of prefix to make sure there is no ambiguity that values like width and height are for layout calculations and not values of UIView derived from frame. But I'm not 100% happy of the solution. Like for the edge values, how about a sub-type?

    let root = view!
    root.backgroundColor = .red
    root.yoga.usesYoga = true
    root.yoga.width = view.bounds.size.width
    root.yoga.height = view.bounds.size.height
    root.yoga.alignItems = .center
    root.yoga.justifyContent = .center
    
    CLA Signed 
    opened by hartbit 45
  • 'algorithm' file not found (since RN 0.53)

    'algorithm' file not found (since RN 0.53)

    Report

    ☝️ However, this is very similar to this other issue. Could it be possible to fix these kind of errors in a bit more structural way? 🤔

    Issues and Steps to Reproduce

    We've got this in our PodFile:

    pod 'React', :path => 'node_modules/react-native', :subspecs => [
      'Core',
      'CxxBridge',
      'DevSupport',
      'RCTText',
      'RCTNetwork',
      'RCTWebSocket',
      'RCTImage',
      'RCTAnimation',
    ]
    pod 'yoga', :path => 'node_modules/react-native/ReactCommon/yoga'
    

    Prior to ReactNative 0.53 this worked. After upgrading to the latest it doesn't.

    Expected Behavior

    A successful build

    Actual Behavior

    This error:

    screen shot 2018-02-07 at 10 49 03

    opened by Jpunt 44
  • Alter layout engine to conform closer to W3C spec

    Alter layout engine to conform closer to W3C spec

    In my team's usage of css-layout, we've found it to behave differently than what is described in the W3C spec for flexbox. We've made some changes to make the implementation more closely conform to the W3C spec and to clearly define where its behavior differs from the spec.

    The primary goals of this change are:

    • Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec.
    • Support for flex-shrink.
    • Conformance with layout effects of "overflow: hidden".

    Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js):

    • Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'.
    • The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order.
    • The 'order' property is not supported. The order of flex items is always defined by document order.
    • The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported.
    • The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported.
    • Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations:
      • flex: 0 is equivalent to flex: 0 0 auto
      • flex: n (where n is a positive value) is equivalent to flex: n 0 0
      • flex: -1 (or any negative value) is equivalent to flex: 0 1 auto
    • Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0.
    • The 'baseline' value is not supported for alignItems and alignSelf properties.
    • Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages.
    • There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images).
    • There is no support for forced breaks.
    • It does not support vertical inline directions (top-to-bottom or bottom-to-top text).

    And here is how the implementation deviates from the standard (this is also documented in Layout.js):

    • Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0.
    • Min/Max sizes in the main axis are not honored when resolving flexible lengths.
    • The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
    opened by rigdern 42
  • Gap/row-gap/column/gap properties

    Gap/row-gap/column/gap properties

    Report

    In the drafts of box alignment level 3, there's the properties row-gap and column-gap that allow the user to specify the gaps between rows and columns.

    It is a draft, so it might be premature to implement now. Do we want to support this now? (I can take a shot at it if I get time!)

    Algorithm Feature Request 
    opened by jacobp100 33
  • Added feature to use rounded values

    Added feature to use rounded values

    Added an experimental feature to allow to use only rounded values. See #184. It's not a perfect solution and definitely can be further improved. I'm looking forward to your ideas.

    CLA Signed 
    opened by woehrl01 33
  • Feature auto margin

    Feature auto margin

    Even so I know there are some opinions against margin: 0 auto it's still part of the spec: https://www.w3.org/TR/css-flexbox-1/#auto-margins and pretty usefull if you have to position via justify-content.

    This PR adds an implementation for that.

    It adds an additonal YGUnitAuto and margins got YGNodeStyleSetMarginAuto functions as well.

    CLA Signed 
    opened by woehrl01 32
  • Feature: possibility to hide nodes

    Feature: possibility to hide nodes

    I know this is currently by design, but it would be great if we could hide / show nodes. Any roadmap on this? Maybe we can have a chat and I can implement this?

    opened by roxlu 31
  • Restructure the C# bindings for Yoga to be based on .NET Standard 2.0 and the new .NET 6.0+ target platform work.

    Restructure the C# bindings for Yoga to be based on .NET Standard 2.0 and the new .NET 6.0+ target platform work.

    Updated the C# bindings to build using the new simplified .NET SDK tooling. The C# projection now builds for .NET Standard 2.0 (to support Unity, .NET Framework, UWP, and modern .NET) and .NET 6.0 for iOS (to have the native calls correctly support calling into a statically-linked library).

    The native changes were needed to get the C# tests passing on Windows x64 (tested locally).

    This PR does not update any build, test, or package scripts. I can either add that to this PR or follow up with another PR.

    CLA Signed 
    opened by jkoritzinsky 5
  • Make Yoga “GitHub First”

    Make Yoga “GitHub First”

    Today, the source of truth for Yoga’s source code is inside of Meta. Yoga is projected out of our monorepo, into GitHub.

    Working in a monorepo with product code can have a lot of advantages. Changes are validated against the test coverage of real products, and it’s easy to make API changes which span library and product code. Engineers at Meta, including most on the React Native team, use the tooling built for the monorepo as well.

    For its advantages, this structure creates issues in OSS projects that affect both React Native and Yoga. PRs are duplicated into internal “diffs” and we have two sets of code reviews, with a lack of transparency, and an increase in complexity in merging and getting sign off for changes made OSS first. It also means that the “easy” way to develop a change is one that is non-transparent, showing up in OSS once the commit happens.

    Yoga has a relatively small, testable, API surface. As such we get a good amount of coverage from the tests, and don’t often have these sort of breaking changes the monorepo setup helps with. The divide instead creates barriers in contribution, and the need for duplication of resources between OSS and external builds.

    This issue tracks a goal of moving Yoga to be “GitHub first”, where the source of truth and contribution becomes GitHub, and code is then synced from GitHub to fbsource, instead of the other way around. This will require a good amount of technical changes internally, but also creates changes to the workflow of reviewers (and limits the pool of those able to execute on changes). I think the risks are still likely worth it though.

    opened by NickGerleman 0
  • Set C++ version consistently to C++ 17

    Set C++ version consistently to C++ 17

    Summary: This sets the C++ standard to C++ 17 in the working builds and Apple. GTest will stop supporting C++ 11 soon, so we need to update. C++ 14 is more embeddable, but C++ 17 support and usage should be relatively common now and the language version adds quite a bit.

    Changelog: [Internal]

    Differential Revision: D42285391

    CLA Signed fb-exported 
    opened by NickGerleman 5
  • Import

    Import "Fix percent absolute position and size calcuate different with web" behind experimental feature (#1028)

    Fixes #850

    https://github.com/facebook/yoga/issues/850 describes a conformance issue where positioning of an absolute child using percentages is not calculated against the correct box size.

    This takes the fix for that in https://github.com/facebook/yoga/pull/1028, regenerates tests, and fixes tests so that the experimental feature can be enabled. Goal is to run this as an experiment internally to see if we can enable by default.

    Changelog: [Internal]

    CLA Signed 
    opened by NickGerleman 1
  • Provide (and document) an easy way to run tests on Apple Silicon

    Provide (and document) an easy way to run tests on Apple Silicon

    Request

    Provide, and clearly document an easy way to run yoga's test suite on Apple Silicon macs.

    Context

    • Apple Silicon macs are a popular platform. Especially for mobile developers who make up much of Yoga's audience.
    • It is very difficult to work with and/or contribute to Yoga without being able to run the tests.
    • This will likely require bypassing Buck as Buck does not currently run on Apple Silicon macs. The testing setup is based on gtest, so it should relatively straightforward to set it up so that it works in standalone manner. Unfortunately I lack the experience with the C/C++ build tool ecosystem to do this myself.

    Alternatives

    • Fix Buck to work on Apple Silicon. There is a partial PR here: https://github.com/facebook/buck/pull/2684
    opened by nicoburns 7
Releases(v1.19.0)
  • v1.19.0(May 21, 2021)

  • 1.14.0(Apr 8, 2019)

  • 1.12.0-pre.3(Mar 22, 2019)

  • 1.12.0-pre.2(Mar 22, 2019)

  • 1.12.0-pre.1(Mar 4, 2019)

  • 1.9.0(Jul 12, 2018)

  • 1.6.0(Jul 13, 2017)

    This release contains a bunch of big fixes:

    • Rounding fixes https://github.com/facebook/yoga/commit/24e2fc95dd996a6de2fcfb1e3aaa8ccdacdc17f2 https://github.com/facebook/yoga/commit/5d75c7c4c8095a033ba77045aba197dc122de7cf https://github.com/facebook/yoga/commit/b378a685a434926cc22a5477a7e764023b066478
    • Flex fixes https://github.com/facebook/yoga/commit/ca2c607f9004303f47870200e8018a634de5b594 https://github.com/facebook/yoga/commit/f2612192c531e0c6c2e9e4089c3c257ba5c0ed8f https://github.com/facebook/yoga/commit/85c2e406e4f75c301313b31f1a67169d7470ff93
    • Absolute layout fixes https://github.com/facebook/yoga/commit/56b10fc35bc3c861030358b263d316371e8ac65e https://github.com/facebook/yoga/commit/629e401debe1e50fd13c25a39e14fb7111fa8c13
    • Overflow fixes https://github.com/facebook/yoga/commit/488a7c1fe0bfea76b645fd1ea4cbd9ccb0578acb https://github.com/facebook/yoga/commit/7640cd667f8c6108c686e11eacc054b0be6d301c
    • Measure fixes https://github.com/facebook/yoga/commit/cd1dbc3f0f668b2835e5db62e16ae33f4add1fc3 https://github.com/facebook/yoga/commit/b2b0c7ee37d48ed3438552dc9cf528f64088bbdb
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(May 10, 2017)

    Big thanks to everyone who contributed to this release.

    Bug fixes

    • Measure functions now get called even if no space is left over. This is done for web compatibility. https://github.com/facebook/yoga/commit/f6b17183c5847469c6b13f5af5a498888c6ce4f4
    • Fix bug where items were stretching within parents when they should not. For example when a parent has alignItems:center. To use the legacy behaviour set useLegacyStretchBehaviour on a node's config object. https://github.com/facebook/yoga/commit/203577724ed65e426a39901ceb3e779c7eb5160b
    • Allow flexible root containers in YogaKit. https://github.com/facebook/yoga/commit/849de89a58096c291c26c88b37400fd434ab93b2
    • Fix flex-wrap with max constraint. https://github.com/facebook/yoga/commit/3178e3bf15dac4f52bfc6943af94a061c9e160df

    API changes

    • YogaNodeAPI interface no longer exists. https://github.com/facebook/yoga/commit/1b3e9715495142b7500a02adf563243ad0d0b642
    • in C# StyleAspectRatio has been renamed AspectRatio. https://github.com/facebook/yoga/commit/8891ea1a7a066e3121787a888e469aae44fa1b3f
    • YGLogger has moved into YGConfig so it is no longer global. It also passes along a node in cases where it makes sense so you have the ability to show errors based on a node's context. https://github.com/facebook/yoga/commit/91230ae177fdfa6b73cf8aa505e2d91e3bea062f

    Features

    • Pixel grid rounding is no longer experimental. We have been using it for a while and this release contains several improvements. Report bugs if you find them. https://github.com/facebook/yoga/commit/aa5b296ac78f7a22e1aeaf4891243c6bb76488e2 https://github.com/facebook/yoga/commit/3db38f2a80cd331bb757eba65baa2d10c9b41f39 https://github.com/facebook/yoga/commit/40e1bf6ce3ff95da4f1df2b64ddcb9caefb9cea9
    • Support for percentage values in YogaKit! https://github.com/facebook/yoga/commit/7b89a1dd4826487bd02a3e63835dfc684790e6a3
    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Apr 12, 2017)

    Big thanks to @woehrl01 for all the fixes and performance improvements in this release.

    Bug fixes

    • Take margin into account on max dimension https://github.com/facebook/yoga/commit/09f0c2d8ce375fe95322055fcdb2361bbb5c11e1
    • Fix align-content: center, flex-end alignment with margin https://github.com/facebook/yoga/commit/b94466e502d9c08ef6399c4f7732d762b525ad71
    • Invalidate layout when node is removed from tree https://github.com/facebook/yoga/commit/249d010dad6b504cf3181e70b6ecfa57ef26e998
    • Set hasNewLayout on display changes. https://github.com/facebook/yoga/commit/ebdf82f4913cc336ed9971e9612ab51f0e661386
    • Fix position on root node with RTL direction https://github.com/facebook/yoga/commit/e9927377b58a2bcac3615d79062ad6d81854bcdc
    • Fix min constraint incorrectly reducing available space https://github.com/facebook/yoga/commit/25f14a191720c4d97c82e131af7dab7574d81332

    Performance improvements

    • Reduce the number of expensive JNI calls. https://github.com/facebook/yoga/commit/5884ab7b76a66b2a5b22a8ebd164f7a9b8f551ed https://github.com/facebook/yoga/commit/5112564f083422194cdb1baf1a97c0308cbc14cb

    API changes

    • Move point scale factor to reside on the config instead of being a global flag. https://github.com/facebook/yoga/commit/406c8a21175138e9f63e8081bff2d0de588d52e9

    Features

    • Allow YogaLayout on android to be created outside of xml. https://github.com/facebook/yoga/commit/f66f52d1bae62b0ad517a113ec508cbf2e4d6c4f
    • Optimize log print by using html format https://github.com/facebook/yoga/commit/586b57009a50d5eaed45981e8ef699001b9a2ed6
    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Mar 7, 2017)

    Bug fixes

    • Fix bug with display: none not invalidating children properly https://github.com/facebook/yoga/commit/a706f4c97cbf52d66dcf06288c3fd85e955daa36
    • Handle margin-start and margin-end with 'auto' value https://github.com/facebook/yoga/commit/8668e43f6d09f77827c4db9a53923c0586845a56
    • Fix percentages in flexing parents https://github.com/facebook/yoga/commit/17e3dca9f91bddee0bf3771ecf19a0d1595c330d

    Behavior changes

    • Pass parent size instead of root size as parameters to YGNodeCalculateLayout. https://github.com/facebook/yoga/commit/1cd7363beada3c5a6af8808dbaa301cbd1a9f43f
    • Flex getters now return the value which was set on them / the default value instead of a computed value. https://github.com/facebook/yoga/commit/3346f9511a77d88173e6d9a71d9c4cdf4dde0716

    Features

    • Add ability to configure Yoga to use web defaults https://github.com/facebook/yoga/commit/62f47190fb2c13d47b13efacfc237f30ab312b51
    • Add a configuration option to nodes for things like experiments and various other things which were previously global configs. https://github.com/facebook/yoga/commit/37c48257ae300ffbf0f2644a058270224b347f34
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Feb 23, 2017)

    Bug fixes:

    • https://github.com/facebook/yoga/commit/240c2dd6573367cd94bfa4893316347b75b2fc18
    • https://github.com/facebook/yoga/commit/adf8691093d57b75d19f5fc9c9a404a5d7f0cbc7
    • https://github.com/facebook/yoga/commit/063f65d0651c87a7e3d96b94679dacd8a35eb13e
    • https://github.com/facebook/yoga/commit/ea8b7e0c918cab7e976bd05ef2390c5dec33d410
    • https://github.com/facebook/yoga/commit/6b39165801f588f3194ac9986400bc7991218368
    • https://github.com/facebook/yoga/commit/4f5c7ed6afa72dd14e37b73f40fd88b2223a5d45

    Behavior changes:

    • Return Undefined for edges without set values and not their computed value. This allows users to correctly check if a value is set / has changed. https://github.com/facebook/yoga/commit/168ae4099d039d20129f44d4eb63499e00db9073

    API changes:

    • https://github.com/facebook/yoga/commit/9d2839f8cafccb7a558c5f376f959a5c1e6a4829 Changes YGPixel to be named YGPoint. This is a small change which should not effect most users of the library. Reason for this change is that we will want to start performing more operations on 'points' which don't map to physical pixels.

    Features:

    • Add support for space-between and space-around on align-content https://github.com/facebook/yoga/commit/6a7ad2125d2ecb1daf9c0c748b66be959dc18f06
    • Add support for auto margins https://github.com/facebook/yoga/commit/1146013e9eed00b4e20db00b238d0ad5f7184523
    • Add support for wrap-reverse https://github.com/facebook/yoga/commit/20536923d6b7ec41ebf15295abfec754628f5af3
    Source code(tar.gz)
    Source code(zip)
  • v2017.02.07.00(Feb 7, 2017)

    • Handle minWidth == maxWidth as width. improves perf by not calling measure function. (https://github.com/facebook/yoga/commit/46817a38c310fadc972b60af01e6fc6e3118f271)
    • Added property display: flex and none (https://github.com/facebook/yoga/commit/e567502750731c05bca81ea594927cfab96529de)
    • Return raw style from style setters (https://github.com/facebook/yoga/commit/93e327f4a5dad99d58f54166019b5ff233e79a79)
    Source code(tar.gz)
    Source code(zip)
  • v2017.01.27.00(Jan 28, 2017)

  • v2017.01.23.00(Jan 26, 2017)

    This is the first official release since the Yoga rename so calling it 1.0.0 as we start with semantic versioning. Future versions will be released on an as needed basis, mostly to release new code to those consuming yoga via package managers.

    If you need a new release to be cut please file a task.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Nov 12, 2015)

  • v1.1.0(Nov 11, 2015)

    • Performance improvements #122 #123 #137 #138 #141
    • Java constants are now public #126
    • C# API added #129, with C# 6 language features suppressed #135, and bugfix #144 (although this still needs to be added to test, CI and release #142)
    • Bug fixed: Fix width being ignored when has a value of 0 #134
    • ESLint applied to codebase #139
    • Reset added to CSSNode #140
    • Improved CSSNode API #146

    NOTE: The npm process for this release failed, please use v1.1.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Sep 8, 2015)

  • v0.0.6(Aug 21, 2015)

Owner
Meta
We are working to build community through open source technology. NB: members must have two-factor auth.
Meta
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.

FlexLayout adds a nice Swift interface to the highly optimized Yoga flexbox implementation. Concise, intuitive & chainable syntax. Flexbox is an incre

layoutBox 1.7k Dec 30, 2022
Flexbox in Swift, using Facebook's css-layout.

SwiftBox A Swift wrapper around Facebook's implementation of CSS's flexbox. Example let parent = Node(size: CGSize(width: 300, height: 300),

Josh Abernathy 811 Jun 23, 2022
Zelda 是一个支持链式语法的 FlexBox 布局库,是针对 YogaKit 的二次封装

Zelda 是一个支持链式语法的 FlexBox 布局库,是针对 YogaKit 的二次封装,可以快速的让 iOS 原生开发人员使用 FlexBox 技术进行 UI 布局。

饼 4 Aug 24, 2021
Ios-quizzer - The app implements basic features of a quiz app using MVC pattern

Quizzer App The app implements basic features of a quiz app using MVC pattern.

Stefan 2 May 10, 2022
Auto Layout (and manual layout) in one line.

Auto Layout (and manual layout) in one line. Quick Look view.bb.centerX().below(view2).size(100) It’s equivalent to iOS 9 API: view.centerXAnchor.cons

Javier Zhang 74 Oct 19, 2022
Auto Layout made easy with the Custom Layout.

Auto Layout made easy with the Custom Layout. Getting started CocoaPods CocoaPods is a dependency manager for Cocoa projects. You can install it with

Malith Nadeeshan 1 Jan 16, 2022
AppStoreClone - Understanding the complex layout of app store using UICompositional layout in swift

AppStoreClone Understanding the complex layout of app store using UICompositiona

Dheeraj Kumar Sharma 8 Dec 28, 2022
A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewFlowLayout.

WrapLayout A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewF

Hiroshi Kimura 6 Sep 27, 2022
UIView category which makes it easy to create layout constraints in code

FLKAutoLayout FLKAutoLayout is a collection of categories on UIView which makes it easy to setup layout constraints in code. FLKAutoLayout creates sim

Florian Kugler 1.5k Nov 24, 2022
an iOS cheat engine for JavaScript APIs & Html5 UI

H5GG an iOS cheat engine for JavaScript APIs & Html5 UI. provide memory apis likely (Android)GameGuardian's Lua APIs. support load scripts(*.js or *.h

null 216 Jan 4, 2023
iOS client for the TradeOgre.com crypto-to-crypto trading platform

TradeOgre iOS Overview TradeOgre iOS is an iOS client for the TrageOgre.com website and crypto-exchange platform. I was looking for their iOS client,

Kyle Roucis 1 Feb 1, 2022
BrickKit is a delightful layout library for iOS and tvOS. It is written entirely in Swift!

BrickKit is a delightful layout library for iOS and tvOS. It is written entirely in Swift! Deprecated BrickKit is being phased out at Wayfair, and the

Wayfair Tech – Archive 608 Sep 15, 2022
LayoutKit is a fast view layout library for iOS, macOS, and tvOS.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. LayoutKit is a fast view layout library for iOS, macOS, a

LinkedIn's Attic 3.2k Dec 27, 2022
A powerful Swift programmatic UI layout framework.

Build dynamic and beautiful user interfaces like a boss, with Swift. Neon is built around how user interfaces are naturally and intuitively designed.

Mike 4.6k Dec 26, 2022
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]

Extremely Fast views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainabl

layoutBox 2.1k Dec 22, 2022
A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:

Cartography ?? ?? Using Cartography, you can set up your Auto Layout constraints in declarative code and without any stringly typing! In short, it all

Robb Böhnke 7.3k Jan 4, 2023
An easy way to create and layout UI components for iOS (Swift version).

Introduction Cupcake is a framework that allow you to easily create and layout UI components for iOS 8.0+. It use chaining syntax and provides some fr

nerdycat 288 Oct 9, 2022
Auto Layout made easy

EasyPeasy is a Swift framework that lets you create Auto Layout constraints programmatically without headaches and never ending boilerplate code. Besi

Carlos Vidal 1.9k Dec 23, 2022
Lightweight Swift framework for Apple's Auto-Layout

I am glad to share with you a lightweight Swift framework for Apple's Auto-Layout. It helps you write readable and compact UI code using simple API. A

null 349 Dec 20, 2022