mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
33 lines
589 B
Python
33 lines
589 B
Python
from textual.app import App
|
|
from textual.widgets import Static
|
|
|
|
|
|
class BoxSizingApp(App):
|
|
CSS = """
|
|
Screen {
|
|
background: white;
|
|
color: black;
|
|
}
|
|
Static {
|
|
background: blue 20%;
|
|
height: 5;
|
|
margin: 2;
|
|
padding: 1;
|
|
border: wide black;
|
|
}
|
|
#static1 {
|
|
box-sizing: border-box;
|
|
}
|
|
#static2 {
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
"""
|
|
|
|
def compose(self):
|
|
yield Static("Hello, World!", id="static1")
|
|
yield Static("Hello, World!", id="static2")
|
|
|
|
|
|
app = BoxSizingApp()
|