mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Factor out css color syntax into snippet.
This refactoring allows the _same_ paragraph(s) about the syntax of a color in Textual CSS to be reused throughout the docs, preventing us from repeating ourselves and allowing us to be more consistent.
This commit is contained in:
@@ -8,13 +8,7 @@ The `background` rule sets the background color of a widget with an optional tra
|
||||
background: <COLOR> [<PERCENTAGE>];
|
||||
```
|
||||
|
||||
The legal values for `<COLOR>` are dependant on the [class `Color`][textual.color.Color] and include:
|
||||
|
||||
- a recognised [named color](../../api/color#textual.color--named-colors) (e.g., `red`);
|
||||
- a hexadecimal number representing the RGB values of the color (e.g., `#F35573`);
|
||||
- a color description in the HSL system (e.g., `hsl(290,70%,80%)`)
|
||||
|
||||
For more details about the exact formats accepted, see [the class method `Color.parse`][textual.color.Color.parse].
|
||||
--8<-- "docs/styles/snippets/color_css_syntax.md"
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
7
docs/styles/snippets/color_css_syntax.md
Normal file
7
docs/styles/snippets/color_css_syntax.md
Normal file
@@ -0,0 +1,7 @@
|
||||
The legal values for `<COLOR>` are dependant on the [class `Color`][textual.color.Color] and include:
|
||||
|
||||
- a recognised [named color](../../api/color#textual.color--named-colors) (e.g., `red`);
|
||||
- a hexadecimal number representing the RGB values of the color (e.g., `#F35573`);
|
||||
- a color description in the HSL system (e.g., `hsl(290,70%,80%)`)
|
||||
|
||||
For more details about the exact formats accepted, see [the class method `Color.parse`][textual.color.Color.parse].
|
||||
Reference in New Issue
Block a user