Skip to content

Commit 8760c3c

Browse files
authored
Merge pull request #1318 from davep/issue/1316/label-width
Change the default width of a label to auto
2 parents 6295eff + 2e6e43e commit 8760c3c

File tree

3 files changed

+129
-122
lines changed

3 files changed

+129
-122
lines changed

CHANGELOG.md

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

1818
- Rebuilt `DirectoryTree` with new `Tree` control.
19+
- The default `width` of a `Label` is now `auto`.
1920

2021
### Fixed
2122

src/textual/widgets/_label.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@
55

66
class Label(Static):
77
"""A simple label widget for displaying text-oriented renderables."""
8+
9+
DEFAULT_CSS = """
10+
Label {
11+
width: auto;
12+
height: auto;
13+
}
14+
"""
15+
"""str: The default styling of a `Label`."""

0 commit comments

Comments
 (0)