mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Replace statics with labels.
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
Static {
|
Label {
|
||||||
height:1fr;
|
height:1fr;
|
||||||
content-align: center middle;
|
content-align: center middle;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
#static1 {
|
#label1 {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
#static2 {
|
#label2 {
|
||||||
color: rgb(0, 255, 0);
|
color: rgb(0, 255, 0);
|
||||||
}
|
}
|
||||||
#static3 {
|
#label3 {
|
||||||
color: hsl(240, 100%, 50%)
|
color: hsl(240, 100%, 50%)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 ColorApp(App):
|
class ColorApp(App):
|
||||||
def compose(self):
|
def compose(self):
|
||||||
yield Static("I'm red!", id="static1")
|
yield Label("I'm red!", id="label1")
|
||||||
yield Static("I'm rgb(0, 255, 0)!", id="static2")
|
yield Label("I'm rgb(0, 255, 0)!", id="label2")
|
||||||
yield Static("I'm hsl(240, 100%, 50%)!", id="static3")
|
yield Label("I'm hsl(240, 100%, 50%)!", id="label3")
|
||||||
|
|
||||||
|
|
||||||
app = ColorApp(css_path="color.css")
|
app = ColorApp(css_path="color.css")
|
||||||
|
|||||||
Reference in New Issue
Block a user