Use labels instead of statics.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-21 16:49:27 +00:00
parent a617d4091c
commit e789c9c006
2 changed files with 6 additions and 6 deletions

View File

@@ -3,8 +3,8 @@ Screen {
color: black; color: black;
} }
Static { Label {
margin: 4 8; margin: 4 8;
background: blue 20%; background: blue 20%;
border: blue wide; border: blue wide;
} }

View File

@@ -1,5 +1,5 @@
from textual.app import App from textual.app import App
from textual.widgets import Static from textual.widgets import Label
TEXT = """I must not fear. TEXT = """I must not fear.
Fear is the mind-killer. Fear is the mind-killer.
@@ -12,7 +12,7 @@ Where the fear has gone there will be nothing. Only I will remain."""
class MarginApp(App): class MarginApp(App):
def compose(self): def compose(self):
yield Static(TEXT) yield Label(TEXT)
app = MarginApp(css_path="margin.css") app = MarginApp(css_path="margin.css")