mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add examples for min/max width/height.
This commit is contained in:
16
docs/examples/styles/max_width.py
Normal file
16
docs/examples/styles/max_width.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Vertical
|
||||
from textual.widgets import Placeholder
|
||||
|
||||
|
||||
class MaxWidthApp(App):
|
||||
def compose(self):
|
||||
yield Vertical(
|
||||
Placeholder("max-width: 50h", id="p1"),
|
||||
Placeholder("max-width: 999", id="p2"),
|
||||
Placeholder("max-width: 50%", id="p3"),
|
||||
Placeholder("max-width: 30", id="p4"),
|
||||
)
|
||||
|
||||
|
||||
app = MaxWidthApp(css_path="max_width.css")
|
||||
Reference in New Issue
Block a user