Update opacity example.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-22 18:38:14 +00:00
parent 8c0f1dc83c
commit bebd054e5e
2 changed files with 9 additions and 8 deletions

View File

@@ -19,10 +19,11 @@
}
Screen {
background: antiquewhite;
background: black;
}
Static {
Label {
width: 100%;
height: 1fr;
border: outer dodgerblue;
background: lightseagreen;

View File

@@ -1,14 +1,14 @@
from textual.app import App
from textual.widgets import Static
from textual.widgets import Label
class OpacityApp(App):
def compose(self):
yield Static("opacity: 0%", id="zero-opacity")
yield Static("opacity: 25%", id="quarter-opacity")
yield Static("opacity: 50%", id="half-opacity")
yield Static("opacity: 75%", id="three-quarter-opacity")
yield Static("opacity: 100%", id="full-opacity")
yield Label("opacity: 0%", id="zero-opacity")
yield Label("opacity: 25%", id="quarter-opacity")
yield Label("opacity: 50%", id="half-opacity")
yield Label("opacity: 75%", id="three-quarter-opacity")
yield Label("opacity: 100%", id="full-opacity")
app = OpacityApp(css_path="opacity.css")