Merge pull request #765 from Textualize/layer-order

Layer order
This commit is contained in:
Will McGugan
2022-09-14 11:14:52 +01:00
committed by GitHub
6 changed files with 79 additions and 25 deletions

21
sandbox/will/offset.css Normal file
View File

@@ -0,0 +1,21 @@
Screen {
layout: center;
}
#parent {
width: 32;
height: 8;
background: $panel;
}
#tag {
color: $text;
background: $success;
padding: 2 4;
width: auto;
offset: -8 -4;
}
#child {
background: red;
}

17
sandbox/will/offset.py Normal file
View File

@@ -0,0 +1,17 @@
from textual import layout
from textual.app import App, ComposeResult
from textual.widgets import Static
class OffsetExample(App):
def compose(self) -> ComposeResult:
yield layout.Vertical(
Static("Child", id="child"),
id="parent"
)
yield Static("Tag", id="tag")
app = OffsetExample(css_path="offset.css")
if __name__ == "__main__":
app.run()