mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Headings
This commit is contained in:
@@ -151,7 +151,7 @@ If you run this you will see the height of the widget now grows to accommodate t
|
||||
```{.textual path="docs/examples/guide/styles/dimensions02.py"}
|
||||
```
|
||||
|
||||
#### Units
|
||||
### Units
|
||||
|
||||
Textual offers a few different *units* which allow you to specify dimensions relative to the screen or container. Relative units can better make use of available space if the user resizes the terminal.
|
||||
|
||||
@@ -185,6 +185,8 @@ With the width set to `"50%"` and the height set to `"80%"`, the widget will kee
|
||||
```{.textual path="docs/examples/guide/styles/dimensions03.py" columns="120" lines="40"}
|
||||
```
|
||||
|
||||
#### FR units
|
||||
|
||||
Percentage units can be problematic for some relative values. For instance, if we want to divide the screen into thirds, we would have to set a dimension to `33.3333333333%` which is awkward. Textual supports `fr` units which are often better than percentage-based units for these situations.
|
||||
|
||||
When specifying `fr` units for a given dimension, Textual will divide the available space by the sum of the `fr` units on that dimension. That space will then be divided amongst the widgets as a proportion of their individual `fr` values.
|
||||
|
||||
Reference in New Issue
Block a user