{"id":17053073,"url":"https://github.com/bschwind/yoga-rs","last_synced_at":"2025-04-08T08:17:12.650Z","repository":{"id":57672751,"uuid":"93884038","full_name":"bschwind/yoga-rs","owner":"bschwind","description":"A Rust Wrapper of Facebook's Yoga, a Flexbox layout engine","archived":false,"fork":false,"pushed_at":"2025-01-19T01:28:37.000Z","size":523,"stargazers_count":148,"open_issues_count":2,"forks_count":20,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T07:41:53.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bschwind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-09T17:58:00.000Z","updated_at":"2025-03-19T05:21:36.000Z","dependencies_parsed_at":"2025-01-31T17:01:42.641Z","dependency_job_id":null,"html_url":"https://github.com/bschwind/yoga-rs","commit_stats":{"total_commits":123,"total_committers":9,"mean_commits":"13.666666666666666","dds":0.6260162601626016,"last_synced_commit":"5f698b25d47a24460473f16d404fe28b56923d5b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fyoga-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fyoga-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fyoga-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fyoga-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bschwind","download_url":"https://codeload.github.com/bschwind/yoga-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305905,"owners_count":20917201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T10:11:16.306Z","updated_at":"2025-04-08T08:17:12.631Z","avatar_url":"https://github.com/bschwind.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yoga-rs\n=======\n\n[![Github CI](https://github.com/bschwind/yoga-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/bschwind/yoga-rs/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/yoga.svg)](https://crates.io/crates/yoga)\n[![docs.rs](https://img.shields.io/docsrs/yoga)](https://docs.rs/yoga)\n\nA Rust wrapper for Facebook's [Yoga](https://github.com/facebook/yoga) layout library.\n\nYou may also want to check out [Taffy](https://github.com/dioxuslabs/taffy) (a revived fork of the abandoned [stretch](https://github.com/vislyhq/stretch)) as it is a pure Rust implementation.\n\nDependencies\n------------\n- cargo\n- rustc\n- libc++-dev (LLVM’s libc++)\n\nBuild\n-----\n    $ cargo build --release\n\nRun Example\n-----------\n\t$ cargo run --release --example layout\n\nFormat Code\n-----------\n\t$ cargo +nightly fmt\n\nExample Code\n------------\n```rust\n#[macro_use]\nextern crate yoga;\n\nuse yoga::prelude::*;\nuse yoga::Node;\nuse yoga::StyleUnit::{Auto, UndefinedValue};\n\nfn main() {\n\tlet mut node = Node::new();\n\n\tlet mut child = Node::new();\n\tlet mut other_child = Node::new();\n\n\tnode.insert_child(\u0026mut child, 0);\n\tnode.insert_child(\u0026mut other_child, 1);\n\n\tstyle!(node,\n\t\tMargin(10 pt),\n\t\tMarginLeft(Auto),\n\t\tPaddingHorizontal(4 pt),\n\t\tLeft(16 %),\n\t\tBottom(UndefinedValue)\n\t);\n\n\tlet child_styles = make_styles!(\n\t\tWidth(32 pt),\n\t\tHeight(32 pt),\n\t\tFlexGrow(1.0),\n\t\tMargin(Auto)\n\t);\n\n\tchild.apply_styles(\u0026child_styles);\n\tother_child.apply_styles(\u0026child_styles);\n\n\tnode.calculate_layout(512.0, 512.0, yoga::Direction::LTR);\n\n\tprintln!(\"Layout is {:#?}\", child.get_layout());\n}\n```\n\nTesting\n-------\nThe unit tests are automatically generated based on upstream fixtures and should not be edited manually.\n\n```\n$ cargo test\n```\n\nTo generate the test cases:\nDownload the [ChromeDriver](http://chromedriver.chromium.org) binary and put it somewhere in your `$PATH`. Linux/MacOS example:\n\n```\n$ cp chromedriver /usr/local/bin\n```\n\nChromedriver can also be installed via homebrew.\n\nThen run the following\n\n```bash\n$ cd gentest\n$ npm install # Install the required node modules\n$ npm run gentest # Generate the tests\n$ cargo +nightly fmt # Format the tests for consistency\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbschwind%2Fyoga-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbschwind%2Fyoga-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbschwind%2Fyoga-rs/lists"}