-
Notifications
You must be signed in to change notification settings - Fork 819
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1699 from Textualize/auto-width-inputs
Auto width inputs
- Loading branch information
Showing
5 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.containers import Vertical | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters