Files
textual/docs/styles/max_width.md
darrenburns 9e883d3e45 Document styles (#785)
* Add docs for CSS variables

* Add ref docs for various styles, fix some typos in places
2022-09-15 16:32:23 +01:00

432 B

Max-width

The max-width rule sets a maximum width for a widget.

Syntax

max-width: <SCALAR>;

CSS


/* Set a maximum width of 10 cells */
max-width: 10;

/* Set a maximum width of 25% of the screen width */
max-width: 25vw;

Python

# Set the maximum width to 10 cells
widget.styles.max_width = 10

# Set the maximum width to 25% of the screen width
widget.styles.max_width = "25vw"