Replace statics with labels.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-15 17:24:23 +00:00
parent 11e41ad2e9
commit f0ea8a8664
2 changed files with 9 additions and 8 deletions

View File

@@ -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%)
} }

View File

@@ -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")