I've drafted code to compute width & height with configurable min/max values as well as percentages of parent values. With a testable abstraction. Into "CatTrap".
Yes, Haskell is a nice language for this!
Still need to draft code for adding whitespace according to the CSS Box Model, & tomorrow I'll get this tested. Then it'll be time to implement grids!