mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update text style reference.
[skip ci]
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
# Text-style
|
||||
|
||||
The `text-style` rule enables a number of different ways of displaying text.
|
||||
|
||||
Text styles may be set in combination.
|
||||
For example `bold underline` or `reverse underline strike`.
|
||||
The `text-style` sets the style for the text in a widget.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
text-style: <TEXT STYLE> ...;
|
||||
```
|
||||
--8<-- "docs/snippets/syntax_block_start.md"
|
||||
text-style: <a href="../../css_types/text_style"><text-style></a>;
|
||||
--8<-- "docs/snippets/syntax_block_end.md"
|
||||
|
||||
`text-style` will take all the values specified and will apply that styling combination to the text in the widget.
|
||||
|
||||
### Values
|
||||
|
||||
| Value | Description |
|
||||
|-------------|----------------------------------------------------------------|
|
||||
| `bold` | **bold text** |
|
||||
| `italic` | _italic text_ |
|
||||
| `reverse` | reverse video text (foreground and background colors reversed) |
|
||||
| `underline` | <u>underline text</u> |
|
||||
| `strike` | <s>strikethrough text</s> |
|
||||
--8<-- "docs/snippets/type_syntax/text_style.md"
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
Each of the three text panels has a different text style.
|
||||
Each of the three text panels has a different text style, respectively `bold`, `italic`, and `reverse`, from left to right.
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/styles/text_style.py" lines=14}
|
||||
```
|
||||
|
||||
=== "text_style.py"
|
||||
|
||||
@@ -37,9 +35,23 @@ Each of the three text panels has a different text style.
|
||||
--8<-- "docs/examples/styles/text_style.css"
|
||||
```
|
||||
|
||||
The next example shows all different styles on their own, as well as some combinations of styles in a single widget.
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/styles/text_style.py"}
|
||||
```{.textual path="docs/examples/styles/text_style_all.py"}
|
||||
```
|
||||
|
||||
=== "text_style_all.py"
|
||||
|
||||
```python
|
||||
--8<-- "docs/examples/styles/text_style_all.py"
|
||||
```
|
||||
|
||||
=== "text_style_all.css"
|
||||
|
||||
```css
|
||||
--8<-- "docs/examples/styles/text_style_all.css"
|
||||
```
|
||||
|
||||
## CSS
|
||||
|
||||
Reference in New Issue
Block a user