Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added `index` to `ListView.Selected` event https://github.com/Textualize/textual/pull/5973
- Added `layout` switch to Static.update https://github.com/Textualize/textual/pull/5973

### Fixed

- Fixed `TextArea` issue with the `css` theme, where the background color was stuck from the previous theme https://github.com/Textualize/textual/issues/5964

### Changed

- Improved rendering of Markdown tables (replace Rich table with grid) which allows text selection https://github.com/Textualize/textual/pull/5962
Expand Down
8 changes: 8 additions & 0 deletions src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,14 @@ def _set_theme(self, theme: str) -> None:
self.styles.color = Color.from_rich_color(color)
if background:
self.styles.background = Color.from_rich_color(background)
else:
# When the theme doesn't define a base style (e.g. the `css` theme),
# the TextArea background/color should fallback to its CSS colors.
#
# Since these styles may have already been changed by another theme,
# we need to reset the background/color styles to the default values.
self.styles.color = None
self.styles.background = None

@property
def available_themes(self) -> set[str]:
Expand Down
Loading
Loading