Update example.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-06 14:18:07 +00:00
parent c7c352a38a
commit 1276629431
2 changed files with 9 additions and 9 deletions

View File

@@ -1,18 +1,18 @@
Screen { Screen {
layout: horizontal; layout: horizontal;
} }
Static { Label {
width:1fr; width: 1fr;
} }
#static1 { #lbl1 {
background: red 30%; background: red 30%;
text-style: bold; text-style: bold;
} }
#static2 { #lbl2 {
background: green 30%; background: green 30%;
text-style: italic; text-style: italic;
} }
#static3 { #lbl3 {
background: blue 30%; background: blue 30%;
text-style: reverse; text-style: reverse;
} }

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,9 +12,9 @@ Where the fear has gone there will be nothing. Only I will remain."""
class TextStyleApp(App): class TextStyleApp(App):
def compose(self): def compose(self):
yield Static(TEXT, id="static1") yield Label(TEXT, id="lbl1")
yield Static(TEXT, id="static2") yield Label(TEXT, id="lbl2")
yield Static(TEXT, id="static3") yield Label(TEXT, id="lbl3")
app = TextStyleApp(css_path="text_style.css") app = TextStyleApp(css_path="text_style.css")