Skip to content
/ flex Public

Go implementation of CSS flexbox, port of Facebook's Yoga

License

Notifications You must be signed in to change notification settings

nilslice/flex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

139 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flex - CSS flexbox layout implementation in Go

Go implementation of flexbox CSS layout algorithm. A pure Go port of Facebook's Yoga.

How to use

For usage examples look at _test.go files.

How the port was made

You can read a detailed story

In short:

  • manually ported C code to Go, line-by-line
  • manually ported tests to Go
  • tweak the API from C style to be more Go like. The structure and logic still is very close to C code (this makes porting future C changes easy)

Status

The port is finished. The code works and passess all Yoga tests.

The API is awkward by Go standards but it's the best I could do given that I want to stay close to C version.

Logic is currently synced up to https://github.com/facebook/yoga/commit/c9384762ee367f890a3de57ff3270d8f9c445866

About

Go implementation of CSS flexbox, port of Facebook's Yoga

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages