From 164678ab66a2d4a9a3cf8667e7d76c27aab41f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Thu, 22 Dec 2022 14:05:17 +0000 Subject: [PATCH] Fix reference for layout. --- docs/examples/styles/layout.css | 2 +- docs/examples/styles/layout.py | 14 +++++++------- docs/styles/layout.md | 10 ++++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/examples/styles/layout.css b/docs/examples/styles/layout.css index b0f7e3385..bb43aeb44 100644 --- a/docs/examples/styles/layout.css +++ b/docs/examples/styles/layout.css @@ -10,7 +10,7 @@ height: auto; } -Static { +Label { margin: 1; width: 12; color: black; diff --git a/docs/examples/styles/layout.py b/docs/examples/styles/layout.py index f7c04e984..bc87a4bb0 100644 --- a/docs/examples/styles/layout.py +++ b/docs/examples/styles/layout.py @@ -1,20 +1,20 @@ from textual.app import App from textual.containers import Container -from textual.widgets import Static +from textual.widgets import Label class LayoutApp(App): def compose(self): yield Container( - Static("Layout"), - Static("Is"), - Static("Vertical"), + Label("Layout"), + Label("Is"), + Label("Vertical"), id="vertical-layout", ) yield Container( - Static("Layout"), - Static("Is"), - Static("Horizontal"), + Label("Layout"), + Label("Is"), + Label("Horizontal"), id="horizontal-layout", ) diff --git a/docs/styles/layout.md b/docs/styles/layout.md index e94b77d01..13544bd7e 100644 --- a/docs/styles/layout.md +++ b/docs/styles/layout.md @@ -2,13 +2,13 @@ The `layout` property defines how a widget arranges its children. -See the [layout](../guide/layout.md) guide for more information. - ## Syntax -``` +--8<-- "docs/snippets/syntax_block_start.md" layout: grid | horizontal | vertical; -``` +--8<-- "docs/snippets/syntax_block_end.md" + +The `layout` style takes an option that defines how child widgets will be arranged, as per the table shown below. ### Values @@ -18,6 +18,8 @@ layout: grid | horizontal | vertical; | `horizontal` | Child widgets will be arranged along the horizontal axis, from left to right. | | `vertical` (default) | Child widgets will be arranged along the vertical axis, from top to bottom. | +See the [layout](../guide/layout.md) guide for more information. + ## Example Note how the `layout` property affects the arrangement of widgets in the example below.