Skip to main content

Module style

Module style 

Source
Expand description

BoxStyle: a Lip-Gloss-style box model (padding, border, margin).

Renders content into a standalone Grid, independent of any Backend/Terminal.

BoxStyle does not word-wrap: it lays out already-broken lines (only '\n' is treated specially).

For word-wrapping text to a width first, use Paragraph, then hand the wrapped result to BoxStyle::render. Keeping wrapping and box-model layout separate avoids tying every consumer of this module to Paragraph or the egc feature.

Structsยง

BoxStyle
A box-model wrapper: content, padding, an optional single-line border, and margin, rendered into a standalone Grid via BoxStyle::render.
Boxed
Pairs a BoxStyle with the text it should render, so the pair can implement Widget (which has no room for a text parameter). Build one via BoxStyle::text.
Sides
CSS-style box-model sides: top/right/bottom/left, in terminal cells.