v5.1.0
Textualize/textualv5.1.0Jul 31, 2025by willmcgugan
AI Summary
Adds a new `:empty` pseudo-class for matching widgets with no children and adds support for horizontal scrolling via trackpad.
Key Highlights
- New `:empty` pseudo-class allows hiding containers with no children.
- Added support for left and right mouse scroll for terminals.
New Features
- `empty` pseudo class
- `Screen.action_focus`
- Trackpad horizontal scrolling
- `textual.compose` is now public
Full Release Notes
This release adds an `:empty` pseudo-class which matches widgets with no children. You could use this to hide a container that doesn't have any children, for example:
```css
.container:empty {
display: none;
}
```
Also in this release, support for scrolling left and right via the trackpad or a mouse that supports it. This was a contribution from @fancidev
Full changes below:
## [5.1.0] - 2025-07-31
### Added
- Added `empty` pseudo class, which applies when a widget has no displayed children https://github.com/Textualize/textual/pull/5999
- Added `Screen.action_focus` https://github.com/Textualize/textual/pull/5999
- Added support for left and right mouse scroll for terminals and input devices which support it https://github.com/Textualize/textual/pull/5995
### Changed
- `last-child`, `last-of-type`, `first-child`, and `first-of-type` apply to displayed children only https://github.com/Textualize/textual/pull/5999
- `textual.compose` is now public https://github.com/Textualize/textual/pull/5999