From 50ee4e57f2c294eca58bbbadc860aa813458702c 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: Mon, 19 Dec 2022 18:42:28 +0000 Subject: [PATCH] Add example for grid-gutter. --- docs/examples/styles/grid_gutter.css | 11 +++++++++++ docs/examples/styles/grid_gutter.py | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 docs/examples/styles/grid_gutter.css create mode 100644 docs/examples/styles/grid_gutter.py diff --git a/docs/examples/styles/grid_gutter.css b/docs/examples/styles/grid_gutter.css new file mode 100644 index 000000000..e4f5240e8 --- /dev/null +++ b/docs/examples/styles/grid_gutter.css @@ -0,0 +1,11 @@ +Grid { + grid-size: 2 4; + grid-gutter: 1 2 /* (1)! */ +} + +Label { + border: round white; + content-align: center middle; + width: 100%; + height: 100%; +} diff --git a/docs/examples/styles/grid_gutter.py b/docs/examples/styles/grid_gutter.py new file mode 100644 index 000000000..363d4a37f --- /dev/null +++ b/docs/examples/styles/grid_gutter.py @@ -0,0 +1,20 @@ +from textual.app import App +from textual.containers import Grid +from textual.widgets import Label + + +class MyApp(App): + def compose(self): + yield Grid( + Label("1"), + Label("2"), + Label("3"), + Label("4"), + Label("5"), + Label("6"), + Label("7"), + Label("8"), + ) + + +app = MyApp(css_path="grid_gutter.css")