mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
more docs and diagrams
This commit is contained in:
@@ -3,44 +3,10 @@ from textual.widgets import Static
|
||||
|
||||
|
||||
class OffsetApp(App):
|
||||
CSS = """
|
||||
Screen {
|
||||
background: white;
|
||||
color: black;
|
||||
layout: horizontal;
|
||||
}
|
||||
Static {
|
||||
width: 20;
|
||||
height: 10;
|
||||
content-align: center middle;
|
||||
}
|
||||
|
||||
.paul {
|
||||
offset: 8 2;
|
||||
background: red 20%;
|
||||
border: outer red;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.duncan {
|
||||
offset: 4 10;
|
||||
background: green 20%;
|
||||
border: outer green;
|
||||
color: green;
|
||||
}
|
||||
|
||||
.chani {
|
||||
offset: 0 5;
|
||||
background: blue 20%;
|
||||
border: outer blue;
|
||||
color: blue;
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self):
|
||||
yield Static("Paul (offset 8 2)", classes="paul")
|
||||
yield Static("Duncan (offset 4 10)", classes="duncan")
|
||||
yield Static("Chani (offset 0 5)", classes="chani")
|
||||
|
||||
|
||||
app = OffsetApp()
|
||||
app = OffsetApp(css_path="offset.css")
|
||||
|
||||
Reference in New Issue
Block a user