textual
textual copied to clipboard
Add "c" unit
We should have a "c" unit where 1c == 2 cells for width, but 1 cell for height.
This is to compensate for the cells unit which is roughly twice as tall as it is wide.
So rather than "margin: 1 2" we can do "margin: 1c"
Some notes from our chat:
Margin and padding are SpacingPropertys which currently only accept integers.
Since this unit is a Scalar, they'd have to be updated to support this one specific type of Scalar.
We also spoke about the implicit conversion between 10% and e.g. 10h and whether that's the right thing to do.
Another question raised was: when you store a value of e.g. "10sq" inside styles.height or styles.margin, then read it back, would you get a CELLS or SQUARE Scalar back? We're thinking SQUARE.
Complexity is much higher than we thought, might be worth returning this to backlog but can re-evaluate in a week.
Going to move this to backlog for now. Docs are a priority.