-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
The overlay style (added in Textual v0.24.0) is still undocumented, so I'm not sure if this is a bug or I've misunderstood how the overlay should work.
Here's a minimal example. After typing in the input to show the overlay, the top margin of the button below will disappear:
from textual.app import App, ComposeResult
from textual.widgets import Button, Input, Static
class MyOverlay(Static):
DEFAULT_CSS = """
MyOverlay {
display: none;
overlay: screen;
background: $error;
}
"""
class ExampleApp(App):
CSS = """
Button {
margin: 2;
}
"""
def compose(self) -> ComposeResult:
yield Input(placeholder="Type to show the overlay...")
yield MyOverlay("This overlay removes the margin?")
yield Button("Submit", variant="success")
def on_input_changed(self, event: Input.Changed) -> None:
self.query_one(MyOverlay).display = bool(event.value)
if __name__ == "__main__":
app = ExampleApp()
app.run()Metadata
Metadata
Assignees
Labels
No labels