Layout library for Python (based on Taffy, a rust-powered implementation of CSS Grid/Flexbox)
Project description
Introduction
This package enables target-agnostic layout operations using CSS Grid and Flexbox. Possible uses include UI layouts, page layouts for reports, complex plotting layouts, etc.
It implements Python bindings for Taffy, an implementation of Grid/Flexbox written in Rust. It was originally based on Stretch (hence the name), but has since migrated to use Taffy.
Getting Started
Helpful resources to getting started with layouts using CSS Grid and Flexbox are listed below.
Flexbox
- Flexbox Froggy. This is an interactive tutorial/game that allows you to learn the essential parts of Flexbox in a fun engaging way.
- A Complete Guide To Flexbox by CSS Tricks. This is detailed guide with illustrations and comphrehensive written explanation of the different Flexbox properties and how they work.
- Yoga Playground
CSS Grid
- CSS Grid Garden. This is an interactive tutorial/game that allows you to learn the essential parts of CSS Grid in a fun engaging way.
- A Complete Guide To CSS Grid by CSS Tricks. This is detailed guide with illustrations and comphrehensive written explanation of the different CSS Grid properties and how they work.
Usage
See demos for examples of basic usage.
Building
Install Rust with rustup and use maturin develop
for development and maturin build [--release]
to build.
Testing
Install test dependencies and invoke pytest
. Note that there are ~700 tests, the majority of which are run using Selenium with the Chrome WebDriver, and the complete test suite can take 10+ minutes to complete. Use pytest --lf
to only run the last-failed tests.
NOTE: There is one test fixture max_height_overrides_height_on_root
which is known to fail. This is related to node visibility, see #43.
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for stretchable-1.0.0b2-cp38-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d532a0ff7b486522e4830f6441adc8809b0f33c9c1b77dd6ad80a1572792929a |
|
MD5 | 781b0fc0412028f9758f9f7b2be49332 |
|
BLAKE2b-256 | 116a1724cf2f57d1c347e56672ad15ae38383cff7d5eb3be55f34c33c4923d60 |
Hashes for stretchable-1.0.0b2-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a988f9d46af54ba09131ac14040970656e280673efbcb6c8511030944ccb95d0 |
|
MD5 | 2aa979114d5efaf35d8289fbe4120e0d |
|
BLAKE2b-256 | adfec4267205a184444033dd2798f39088310e6d5b7b6b1006a40ef581ed7f9f |
Hashes for stretchable-1.0.0b2-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5b29ddfa1c869a9245f63e14fc519c2c97cb545677ab46ee56ef6f37b3cc424 |
|
MD5 | 1f5c51f6c61620af7ab739165077297d |
|
BLAKE2b-256 | fca0a5e17e99320ed59e42fc9e8186485109b2d315609a9d10675923bab75737 |
Hashes for stretchable-1.0.0b2-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eff7c81acffa6415d02698974e65f514e32feb2fa84b475cca1abeacdcaed0f8 |
|
MD5 | 886c94d5354b9675ca31e18d7562c227 |
|
BLAKE2b-256 | e4ce271aa768bf29c7b2f5f6486e547296973f37b614d9897116b5c6f750b9fb |
Hashes for stretchable-1.0.0b2-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ed7353648377e18088ef2dc871b041d7f8c45990f191e2fe8b6d7a495205c6 |
|
MD5 | 8774589da9ef3cf9a8b1f0e4aacc6888 |
|
BLAKE2b-256 | 6313ca320f33819ad1c3e5edf64dc82fbc5c9390b8eba283021350aadee62931 |
Hashes for stretchable-1.0.0b2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ecca6966159c88a1acba57f79cf66a0a4e8b4f3dfc5a59be369250f338bc47d |
|
MD5 | 537f1f13d175e5e481255e0a21c0a398 |
|
BLAKE2b-256 | 486e6d2e5e7ef71f80c5f3bb16c9d63e3871d42eeee43b4f6662d994997ccc2a |
Hashes for stretchable-1.0.0b2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4830fe1db09b74ab5b99f776e031ba036d8ab8de9dcd61a0f60c1f38e04f83d9 |
|
MD5 | bdcaf7bcd306e248cff24b954b1a0d15 |
|
BLAKE2b-256 | e98780021ad723b9cb427a1428bdbd68fb5a3b90369f072b617c4735ce917ca9 |
Hashes for stretchable-1.0.0b2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee78c159af8fa872626d5b735c2f8966860749df67af4dd0823400eba80dbe2 |
|
MD5 | 2db279049237110333383f9d31da0927 |
|
BLAKE2b-256 | cfc7843e83e3df47c5926ee044b66607c13199d34d42c8c7c1381d8558a52210 |
Hashes for stretchable-1.0.0b2-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 513c030eabe333885bf2be661fdc4c22ce519b21a3c90155a26b9051919c6c94 |
|
MD5 | 0bebbaa6018d09a291a4e193534f02c2 |
|
BLAKE2b-256 | b7848da71315b65e8ac3c2443348b3a4ed8887dabaa954fd9cead61663e7ac5d |