mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
auto grid docs and test
This commit is contained in:
11
docs/examples/guide/layout/grid_layout_auto.css
Normal file
11
docs/examples/guide/layout/grid_layout_auto.css
Normal file
@@ -0,0 +1,11 @@
|
||||
Screen {
|
||||
layout: grid;
|
||||
grid-size: 3;
|
||||
grid-columns: auto 1fr 1fr;
|
||||
grid-rows: 25% 75%;
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 100%;
|
||||
border: solid green;
|
||||
}
|
||||
19
docs/examples/guide/layout/grid_layout_auto.py
Normal file
19
docs/examples/guide/layout/grid_layout_auto.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class GridLayoutExample(App):
|
||||
CSS_PATH = "grid_layout_auto.css"
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Static("First column", classes="box")
|
||||
yield Static("Two", classes="box")
|
||||
yield Static("Three", classes="box")
|
||||
yield Static("Four", classes="box")
|
||||
yield Static("Five", classes="box")
|
||||
yield Static("Six", classes="box")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = GridLayoutExample()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user