mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update example.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user