mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
more docs
This commit is contained in:
@@ -1,24 +1,27 @@
|
||||
from textual.app import App
|
||||
from textual.widget import Widget
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class WidthApp(App):
|
||||
class DisplayApp(App):
|
||||
CSS = """
|
||||
Screen > Widget {
|
||||
height: 5;
|
||||
background: blue;
|
||||
color: white;
|
||||
border: heavy white;
|
||||
Screen {
|
||||
background: green;
|
||||
}
|
||||
Widget.hidden {
|
||||
Static {
|
||||
height: 5;
|
||||
background: white;
|
||||
color: blue;
|
||||
border: heavy blue;
|
||||
}
|
||||
Static.remove {
|
||||
display: none;
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self):
|
||||
yield Widget(id="widget1")
|
||||
yield Widget(id="widget2", classes="hidden")
|
||||
yield Widget(id="widget3")
|
||||
yield Static("Widget 1")
|
||||
yield Static("widget 2", classes="remove")
|
||||
yield Static("widget 3")
|
||||
|
||||
|
||||
app = WidthApp()
|
||||
app = DisplayApp()
|
||||
|
||||
Reference in New Issue
Block a user