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,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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user