Replace statics with labels.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-15 16:14:56 +00:00
parent d5d24235fa
commit 3a83c26779
2 changed files with 9 additions and 8 deletions

View File

@@ -1,24 +1,25 @@
Screen {
background: white;
}
Screen > Static {
Screen > Label {
width: 100%;
height: 5;
content-align: center middle;
color: white;
margin: 1;
box-sizing: border-box;
}
#static1 {
#label1 {
background: red 20%;
color: red;
border: solid red;
}
#static2 {
#label2 {
background: green 20%;
color: green;
border: dashed green;
}
#static3 {
#label3 {
background: blue 20%;
color: blue;
border: tall blue;

View File

@@ -1,12 +1,12 @@
from textual.app import App
from textual.widgets import Static
from textual.widgets import Label
class BorderApp(App):
def compose(self):
yield Static("My border is solid red", id="static1")
yield Static("My border is dashed green", id="static2")
yield Static("My border is tall blue", id="static3")
yield Label("My border is solid red", id="label1")
yield Label("My border is dashed green", id="label2")
yield Label("My border is tall blue", id="label3")
app = BorderApp(css_path="border.css")