Files
textual/sandbox/will/center.py
Will McGugan cafff08e23 sandbox fix
2022-08-16 20:17:08 +01:00

29 lines
469 B
Python

from textual.app import App
from textual.widgets import Static
class CenterApp(App):
CSS = """
CenterApp Screen {
layout: center;
overflow: auto auto;
}
CenterApp Static {
border: wide $primary;
background: $panel;
width: 50;
height: 20;
margin: 1 2;
content-align: center middle;
}
"""
def compose(self):
yield Static("Hello World!")
app = CenterApp()