* Convert an Ink dimension (number = character cells, or `"50%"` percent string) * to a CSS value. We use `ch` for character-width units so the layout * approximates the terminal in a monospace font.
(value: number | string | undefined)
| 11 | * approximates the terminal in a monospace font. |
| 12 | */ |
| 13 | function toCSSSize(value: number | string | undefined): string | undefined { |
| 14 | if (value === undefined) return undefined |
| 15 | if (typeof value === 'string') return value // already "50%" etc. |
| 16 | return `${value}ch` |
| 17 | } |
| 18 | |
| 19 | // --------------------------------------------------------------------------- |
| 20 | // Border style mapping |