textual icon indicating copy to clipboard operation
textual copied to clipboard

Add "c" unit

Open willmcgugan opened this issue 1 year ago • 2 comments

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"

willmcgugan avatar Sep 23 '22 15:09 willmcgugan

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.

darrenburns avatar Sep 23 '22 15:09 darrenburns

Going to move this to backlog for now. Docs are a priority.

willmcgugan avatar Oct 04 '22 08:10 willmcgugan