mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Split grid reference into subpages.
This commit is contained in:
1
docs/styles/grid/column_span.md
Normal file
1
docs/styles/grid/column_span.md
Normal file
@@ -0,0 +1 @@
|
||||
# Column-span
|
||||
1
docs/styles/grid/grid_columns.md
Normal file
1
docs/styles/grid/grid_columns.md
Normal file
@@ -0,0 +1 @@
|
||||
# Grid-columns
|
||||
1
docs/styles/grid/grid_gutter.md
Normal file
1
docs/styles/grid/grid_gutter.md
Normal file
@@ -0,0 +1 @@
|
||||
# Grid-gutter
|
||||
1
docs/styles/grid/grid_rows.md
Normal file
1
docs/styles/grid/grid_rows.md
Normal file
@@ -0,0 +1 @@
|
||||
# Grid-rows
|
||||
1
docs/styles/grid/grid_size.md
Normal file
1
docs/styles/grid/grid_size.md
Normal file
@@ -0,0 +1 @@
|
||||
# Grid-size
|
||||
54
docs/styles/grid/index.md
Normal file
54
docs/styles/grid/index.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Grid
|
||||
|
||||
There are a number of properties relating to the Textual `grid` layout.
|
||||
|
||||
For an in-depth look at the grid layout, visit the grid [guide](../guide/layout.md#grid).
|
||||
|
||||
| Property | Description |
|
||||
|----------------|------------------------------------------------|
|
||||
| `grid-size` | Number of columns and rows in the grid layout. |
|
||||
| `grid-rows` | Height of grid rows. |
|
||||
| `grid-columns` | Width of grid columns. |
|
||||
| `grid-gutter` | Spacing between grid cells. |
|
||||
| `row-span` | Number of rows a cell spans. |
|
||||
| `column-span` | Number of columns a cell spans. |
|
||||
|
||||
## Syntax
|
||||
|
||||
```sass
|
||||
grid-size: <INTEGER> [<INTEGER>];
|
||||
/* columns first, then rows */
|
||||
grid-rows: <SCALAR> . . .;
|
||||
grid-columns: <SCALAR> . . .;
|
||||
grid-gutter: <SCALAR>;
|
||||
row-span: <INTEGER>;
|
||||
column-span: <INTEGER>;
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
The example below shows all the properties above in action.
|
||||
The `grid-size: 3 4;` declaration sets the grid to 3 columns and 4 rows.
|
||||
The first cell of the grid, tinted magenta, shows a cell spanning multiple rows and columns.
|
||||
The spacing between grid cells is because of the `grid-gutter` declaration.
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/styles/grid.py"}
|
||||
```
|
||||
|
||||
=== "grid.py"
|
||||
|
||||
```python
|
||||
--8<-- "docs/examples/styles/grid.py"
|
||||
```
|
||||
|
||||
=== "grid.css"
|
||||
|
||||
```sass
|
||||
--8<-- "docs/examples/styles/grid.css"
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
||||
The properties listed on this page will only work when the layout is `grid`.
|
||||
1
docs/styles/grid/row_span.md
Normal file
1
docs/styles/grid/row_span.md
Normal file
@@ -0,0 +1 @@
|
||||
# Row-span
|
||||
Reference in New Issue
Block a user