Add subsections for references with 2+ examples.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-09 13:50:45 +00:00
parent 71b859b6e2
commit dd6e73aa39
14 changed files with 103 additions and 4 deletions

View File

@@ -54,6 +54,8 @@ Alternatively, you can see the examples below.
## Examples
### Basic usage
This examples shows three widgets with different border styles.
=== "border.py"
@@ -73,6 +75,8 @@ This examples shows three widgets with different border styles.
```{.textual path="docs/examples/styles/border.py"}
```
### All border types
The next example shows a grid with all the available border types.
=== "border_all.py"
@@ -92,6 +96,30 @@ The next example shows a grid with all the available border types.
```{.textual path="docs/examples/styles/border_all.py"}
```
### Borders and outlines
The next example makes the difference between [`border`](./border.md) and [`outline`](./outline.md) clearer by having three labels side-by-side.
They contain the same text, have the same width and height, and are styled exactly the same up to their `outline` and [`border`](./border.md) rules.
This example also shows that a widget cannot contain both a `border` and an `outline`:
=== "Output"
```{.textual path="docs/examples/styles/outline_vs_border.py"}
```
=== "outline_vs_border.py"
```python
--8<-- "docs/examples/styles/outline_vs_border.py"
```
=== "outline_vs_border.css"
```sass
--8<-- "docs/examples/styles/outline_vs_border.css"
```
## CSS
```sass