mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Tweak example for offset.
This commit is contained in:
@@ -3,10 +3,10 @@ Screen {
|
|||||||
color: black;
|
color: black;
|
||||||
layout: horizontal;
|
layout: horizontal;
|
||||||
}
|
}
|
||||||
Static {
|
Label {
|
||||||
width: 20;
|
width: 20;
|
||||||
height: 10;
|
height: 10;
|
||||||
content-align: center middle;
|
content-align: center middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.paul {
|
.paul {
|
||||||
@@ -24,7 +24,7 @@ Static {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chani {
|
.chani {
|
||||||
offset: 0 5;
|
offset: 0 -2;
|
||||||
background: blue 20%;
|
background: blue 20%;
|
||||||
border: outer blue;
|
border: outer blue;
|
||||||
color: blue;
|
color: blue;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
from textual.app import App
|
from textual.app import App
|
||||||
from textual.widgets import Static
|
from textual.widgets import Label
|
||||||
|
|
||||||
|
|
||||||
class OffsetApp(App):
|
class OffsetApp(App):
|
||||||
def compose(self):
|
def compose(self):
|
||||||
yield Static("Paul (offset 8 2)", classes="paul")
|
yield Label("Paul (offset 8 2)", classes="paul")
|
||||||
yield Static("Duncan (offset 4 10)", classes="duncan")
|
yield Label("Duncan (offset 4 10)", classes="duncan")
|
||||||
yield Static("Chani (offset 0 5)", classes="chani")
|
yield Label("Chani (offset 0 -2)", classes="chani")
|
||||||
|
|
||||||
|
|
||||||
app = OffsetApp(css_path="offset.css")
|
app = OffsetApp(css_path="offset.css")
|
||||||
|
|||||||
Reference in New Issue
Block a user