mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update rule color reference.
This commit is contained in:
@@ -1,18 +1,28 @@
|
|||||||
# Color
|
# Color
|
||||||
|
|
||||||
The `color` rule sets the text color of a widget with an optional.
|
The `color` rule sets the text color of a widget.
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
```
|
--8<-- "docs/snippets/syntax_block_start.md"
|
||||||
color: (<COLOR> | auto) [<PERCENTAGE>];
|
color: (<a href="../css_types/color.md"><color></a> | auto) [<a href="../css_types/percentage.md"><percentage></a>];
|
||||||
```
|
--8<-- "docs/snippets/syntax_block_end.md"
|
||||||
|
|
||||||
Use `auto` to automatically choose a color with suitable contrast for readability.
|
The style `color` needs a [`<color>`](../css_types/color.md) followed by an optional [`<percentage>`](../css_types/percentage.md) to specify the color transparency.
|
||||||
|
|
||||||
|
Instead of a [`<color>`](../css_types/color.md), one can use the special value `"auto"` to choose automatically the color with the best contrast for readability purposes.
|
||||||
|
|
||||||
|
### Values
|
||||||
|
|
||||||
|
#### <color>
|
||||||
|
|
||||||
--8<-- "docs/snippets/type_syntax/color.md"
|
--8<-- "docs/snippets/type_syntax/color.md"
|
||||||
|
|
||||||
The optional [percentage](./css_units/percentage.md) sets the transparency level and will override any transparency specified directly in the color.
|
The alternative value `"auto"` picks the color that provides the best contrast for readability purposes.
|
||||||
|
|
||||||
|
#### <percentage>
|
||||||
|
|
||||||
|
--8<-- "docs/snippets/type_syntax/percentage.md"
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user