mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add CSS and Python syntax for individual axis alignment.
This commit is contained in:
@@ -81,8 +81,13 @@ Each label has been aligned differently inside its container, and its text shows
|
|||||||
```sass
|
```sass
|
||||||
/* Align child widgets to the center. */
|
/* Align child widgets to the center. */
|
||||||
align: center middle;
|
align: center middle;
|
||||||
/* Align child widget to th top right */
|
/* Align child widget to the top right */
|
||||||
align: right top;
|
align: right top;
|
||||||
|
|
||||||
|
/* Change the horizontal alignment of the children of a widget */
|
||||||
|
align-horizontal: right;
|
||||||
|
/* Change the vertical alignment of the children of a widget */
|
||||||
|
align-vertical: middle;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Python
|
## Python
|
||||||
@@ -91,4 +96,9 @@ align: right top;
|
|||||||
widget.styles.align = ("center", "middle")
|
widget.styles.align = ("center", "middle")
|
||||||
# Align child widgets to the top right
|
# Align child widgets to the top right
|
||||||
widget.styles.align = ("right", "top")
|
widget.styles.align = ("right", "top")
|
||||||
|
|
||||||
|
# Change the horizontal alignment of the children of a widget
|
||||||
|
widget.styles.align_horizontal = "right"
|
||||||
|
# Change the vertical alignment of the children of a widget
|
||||||
|
widget.styles.align_vertical = "middle"
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user