mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
more docs
This commit is contained in:
29
docs/examples/styles/background.py
Normal file
29
docs/examples/styles/background.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class BackgroundApp(App):
|
||||
CSS = """
|
||||
Static {
|
||||
height:1fr;
|
||||
content-align: center middle;
|
||||
color: white;
|
||||
}
|
||||
#static1 {
|
||||
background: red;
|
||||
}
|
||||
#static2 {
|
||||
background: rgb(0, 255, 0);
|
||||
}
|
||||
#static3 {
|
||||
background: hsl(240, 100%, 50%);
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self):
|
||||
yield Static("Hello, World!", id="static1")
|
||||
yield Static("Hello, World!", id="static2")
|
||||
yield Static("Hello, World!", id="static3")
|
||||
|
||||
|
||||
app = BackgroundApp()
|
||||
Reference in New Issue
Block a user