mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add text-align CSS type.
This commit is contained in:
37
docs/css_types/text_align.md
Normal file
37
docs/css_types/text_align.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# <text-align>
|
||||
|
||||
The `<text-align>` CSS type represents alignments that can be applied to text.
|
||||
|
||||
!!! warning
|
||||
|
||||
Not to be confused with the [`text-align`](../styles/text_align.md) CSS rule that sets the alignment of text in a widget.
|
||||
|
||||
## Syntax
|
||||
|
||||
--8<-- "docs/snippets/type_syntax/text_align.md"
|
||||
|
||||
## Examples
|
||||
|
||||
### CSS
|
||||
|
||||
```sass
|
||||
* {
|
||||
rule: center;
|
||||
rule: end;
|
||||
rule: justify;
|
||||
rule: left;
|
||||
rule: right;
|
||||
rule: start;
|
||||
}
|
||||
```
|
||||
|
||||
### Python
|
||||
|
||||
```py
|
||||
text_align = "center"
|
||||
text_align = "end"
|
||||
text_align = "justify"
|
||||
text_align = "left"
|
||||
text_align = "right"
|
||||
text_align = "start"
|
||||
```
|
||||
14
docs/snippets/type_syntax/text_align.md
Normal file
14
docs/snippets/type_syntax/text_align.md
Normal file
@@ -0,0 +1,14 @@
|
||||
A [`<text-align>`](/css_types/text_align) can be any of the following values:
|
||||
|
||||
| Value | Alignment type |
|
||||
|-----------|--------------------------------------|
|
||||
| `center` | Center alignment. |
|
||||
| `end` | Alias for `right`. |
|
||||
| `justify` | Text is justified inside the widget. |
|
||||
| `left` | Left alignment. |
|
||||
| `right` | Right alignment. |
|
||||
| `start` | Alias for `left`. |
|
||||
|
||||
!!! tip
|
||||
|
||||
The meanings of `start` and `end` will likely change when RTL languages become supported by Textual.
|
||||
@@ -39,6 +39,7 @@ nav:
|
||||
- "css_types/overflow.md"
|
||||
- "css_types/percentage.md"
|
||||
- "css_types/scalar.md"
|
||||
- "css_types/text_align.md"
|
||||
- "css_types/text_style.md"
|
||||
- "css_types/vertical.md"
|
||||
- Events:
|
||||
|
||||
Reference in New Issue
Block a user