diff --git a/src/textual/app.py b/src/textual/app.py index 8050dc1b36..39ccaeccf9 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -768,6 +768,9 @@ def __init__( self._css_update_count: int = 0 """Incremented when CSS is invalidated.""" + self.theme_variables: dict[str, str] = {} + """Variables generated from the current theme.""" + if self.ENABLE_COMMAND_PALETTE: for _key, binding in self._bindings: if binding.action in {"command_palette", "app.command_palette"}: @@ -1180,7 +1183,10 @@ def get_css_variables(self) -> dict[str, str]: # Apply the additional variables from the theme variables = {**variables, **(theme.variables)} theme_variables = self.get_theme_variable_defaults() - return {**theme_variables, **variables} + + combined_variables = {**theme_variables, **variables} + self.theme_variables = combined_variables + return combined_variables def get_theme(self, theme_name: str) -> Theme | None: """Get a theme by name. diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_search_opens_and_displays_search_list.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_search_opens_and_displays_search_list.svg deleted file mode 100644 index eb86226537..0000000000 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_search_opens_and_displays_search_list.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SearchApp - - - - - - - - - - Search Commands                                                                  - - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - -🔎b - - -bar                                                                            -baz                                                                            -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - - - - - - - - - - - - - - -