Skip to content

Commit e3605d1

Browse files
authored
Merge pull request #1259 from Textualize/fix-1258
Set default container height to 1fr.
2 parents 795265b + cdf7b35 commit e3605d1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717
### Changed
1818

1919
- Rebuilt `DirectoryTree` with new `Tree` control.
20+
- Container widgets now have default height of `1fr`.
2021
- The default `width` of a `Label` is now `auto`.
2122

2223
### Fixed

src/textual/containers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Container(Widget):
66

77
DEFAULT_CSS = """
88
Container {
9+
height: 1fr;
910
layout: vertical;
1011
overflow: auto;
1112
}
@@ -17,6 +18,7 @@ class Vertical(Widget):
1718

1819
DEFAULT_CSS = """
1920
Vertical {
21+
height: 1fr;
2022
layout: vertical;
2123
overflow-y: auto;
2224
}
@@ -28,6 +30,7 @@ class Horizontal(Widget):
2830

2931
DEFAULT_CSS = """
3032
Horizontal {
33+
height: 1fr;
3134
layout: horizontal;
3235
overflow-x: hidden;
3336
}
@@ -39,6 +42,7 @@ class Grid(Widget):
3942

4043
DEFAULT_CSS = """
4144
Grid {
45+
height: 1fr;
4246
layout: grid;
4347
}
4448
"""
@@ -49,6 +53,7 @@ class Content(Widget, can_focus=True, can_focus_children=False):
4953

5054
DEFAULT_CSS = """
5155
Vertical {
56+
height: 1fr;
5257
layout: vertical;
5358
overflow-y: auto;
5459
}

0 commit comments

Comments
 (0)