diff --git a/CHANGELOG.md b/CHANGELOG.md index 990180d91..c35703853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed `TreeNode.toggle` and `TreeNode.toggle_all` not posting a `Tree.NodeExpanded` or `Tree.NodeCollapsed` message https://github.com/Textualize/textual/issues/2535 - `footer--description` component class was being ignored https://github.com/Textualize/textual/issues/2544 - Pasting empty selection in `Input` would raise an exception https://github.com/Textualize/textual/issues/2563 +- Fix for setting dark in App `__init__` https://github.com/Textualize/textual/issues/2583 - Fix issue with scrolling and docks https://github.com/Textualize/textual/issues/2525 ### Added diff --git a/src/textual/app.py b/src/textual/app.py index c8863d764..74585c166 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -604,14 +604,7 @@ class App(Generic[ReturnType], DOMNode): """ self.set_class(dark, "-dark-mode") self.set_class(not dark, "-light-mode") - try: - self.refresh_css() - except ScreenStackError: - # It's possible that `dark` can be set before we have a default - # screen, in an app's `on_load`, for example. So let's eat the - # ScreenStackError -- the above styles will be handled once the - # screen is spun up anyway. - pass + self.call_later(self.refresh_css) def get_driver_class(self) -> Type[Driver]: """Get a driver class for this platform.