https://github.com/randrew/layout

Single-file library for calculating 2D UI layouts using stacking boxes.