-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* border styles * docs for border styles * fix tests * tests * tests and docs * changelog * implement auto * style information fix
- Loading branch information
1 parent
9fb63f9
commit 0509cf8
Showing
27 changed files
with
1,807 additions
and
1,247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Screen { | ||
align: center middle; | ||
} | ||
|
||
Label { | ||
padding: 4 8; | ||
border: heavy red; | ||
|
||
border-title-color: green; | ||
border-title-background: white; | ||
border-title-style: bold; | ||
|
||
border-subtitle-color: magenta; | ||
border-subtitle-background: yellow; | ||
border-subtitle-style: italic; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.widgets import Label | ||
|
||
|
||
class BorderTitleApp(App): | ||
CSS_PATH = "border_title_colors.css" | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Label("Hello, World!") | ||
|
||
def on_mount(self) -> None: | ||
label = self.query_one(Label) | ||
label.border_title = "Textual Rocks" | ||
label.border_subtitle = "Textual Rocks" | ||
|
||
|
||
if __name__ == "__main__": | ||
app = BorderTitleApp() | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
The following examples demonstrates customization of the border color and text style rules. | ||
|
||
=== "Output" | ||
|
||
```{.textual path="docs/examples/styles/border_title_colors.py"} | ||
``` | ||
|
||
=== "border_title_colors.py" | ||
|
||
```python | ||
--8<-- "docs/examples/styles/border_title_colors.py" | ||
``` | ||
|
||
=== "border_title_colors.css" | ||
|
||
```sass | ||
--8<-- "docs/examples/styles/border_title_colors.css" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- [`border-title-align`](./border_title_align.md) to set the title's alignment. | ||
- [`border-title-color`](./border_subtitle_color.md) to set the title's color. | ||
- [`border-title-background`](./border_subtitle_background.md) to set the title's background color. | ||
- [`border-title-style`](./border_subtitle_style.md) to set the title's text style. | ||
|
||
- [`border-subtitle-align`](./border_subtitle_align.md) to set the sub-title's alignment. | ||
- [`border-subtitle-color`](./border_subtitle_color.md) to set the sub-title's color. | ||
- [`border-subtitle-background`](./border_subtitle_background.md) to set the sub-title's background color. | ||
- [`border-subtitle-style`](./border_subtitle_style.md) to set the sub-title's text style. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Border-subtitle-background | ||
|
||
The `border-subtitle-background` style sets the *background* color of the [border_subtitle][textual.widget.Widget.border_subtitle]. | ||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-subtitle-background: (<a href="../../css_types/color"><color></a> | auto) [<a href="../../css_types/percentage"><percentage></a>]; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
|
||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-subtitle-background: blue; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_subtitle_background = "blue" | ||
``` | ||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Border-subtitle-color | ||
|
||
The `border-subtitle-color` style sets the color of the [border_subtitle][textual.widget.Widget.border_subtitle]. | ||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-subtitle-color: (<a href="../../css_types/color"><color></a> | auto) [<a href="../../css_types/percentage"><percentage></a>]; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-subtitle-color: red; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_subtitle_color = "red" | ||
``` | ||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Border-subtitle-style | ||
|
||
The `border-subtitle-style` style sets the text style of the [border_subtitle][textual.widget.Widget.border_subtitle]. | ||
|
||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-subtitle-style: <a href="../../css_types/text_style"><text-style></a>; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-subtitle-style: bold underline; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_subtitle_style = "bold underline" | ||
``` | ||
|
||
|
||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Border-title-background | ||
|
||
The `border-title-background` style sets the *background* color of the [border_title][textual.widget.Widget.border_title]. | ||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-title-background: (<a href="../../css_types/color"><color></a> | auto) [<a href="../../css_types/percentage"><percentage></a>]; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
|
||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-title-background: blue; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_title_background = "blue" | ||
``` | ||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Border-title-color | ||
|
||
The `border-title-color` style sets the color of the [border_title][textual.widget.Widget.border_title]. | ||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-title-color: (<a href="../../css_types/color"><color></a> | auto) [<a href="../../css_types/percentage"><percentage></a>]; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-title-color: red; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_title_color = "red" | ||
``` | ||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Border-title-style | ||
|
||
The `border-title-style` style sets the text style of the [border_title][textual.widget.Widget.border_title]. | ||
|
||
|
||
## Syntax | ||
|
||
--8<-- "docs/snippets/syntax_block_start.md" | ||
border-title-style: <a href="../../css_types/text_style"><text-style></a>; | ||
--8<-- "docs/snippets/syntax_block_end.md" | ||
|
||
|
||
|
||
## Example | ||
|
||
--8<-- "docs/snippets/border_title_color.md" | ||
|
||
|
||
## CSS | ||
|
||
```sass | ||
border-title-style: bold underline; | ||
``` | ||
|
||
## Python | ||
|
||
```python | ||
widget.styles.border_title_style = "bold underline" | ||
``` | ||
|
||
|
||
|
||
## See also | ||
|
||
--8<-- "docs/snippets/see_also_border.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.