Merge pull request #701 from Textualize/docs-layout

Docs layout
This commit is contained in:
Will McGugan
2022-08-30 12:55:58 +01:00
committed by GitHub
4 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#vertical-layout {
layout: vertical;
background: darkmagenta;
height: auto;
}
#horizontal-layout {
layout: horizontal;
background: darkcyan;
height: auto;
}
#center-layout {
layout: center;
background: darkslateblue;
height: 7;
}
Static {
margin: 1;
width: 12;
color: black;
background: yellowgreen;
}

View File

@@ -0,0 +1,27 @@
from textual import layout
from textual.app import App
from textual.widget import Widget
from textual.widgets import Static
class LayoutApp(App):
def compose(self):
yield layout.Container(
Static("Layout"),
Static("Is"),
Static("Vertical"),
id="vertical-layout",
)
yield layout.Container(
Static("Layout"),
Static("Is"),
Static("Horizontal"),
id="horizontal-layout",
)
yield layout.Container(
Static("Center"),
id="center-layout",
)
app = LayoutApp(css_path="layout.css")