mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
22 lines
492 B
Python
22 lines
492 B
Python
from textual.app import App, ComposeResult
|
|
from textual.containers import VerticalScroll
|
|
from textual.widgets import Header, Footer, Label, Input
|
|
|
|
|
|
class InputWidthAutoApp(App[None]):
|
|
CSS = """
|
|
Input.auto {
|
|
width: auto;
|
|
max-width: 100%;
|
|
}
|
|
"""
|
|
|
|
def compose(self) -> ComposeResult:
|
|
yield Header()
|
|
yield Input(placeholder="This has auto width", classes="auto")
|
|
yield Footer()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
InputWidthAutoApp().run()
|