Skip to content

Commit d942e52

Browse files
committed
Fix snapshot, record theme_variables on App
1 parent 6902c1a commit d942e52

File tree

2 files changed

+7
-158
lines changed

2 files changed

+7
-158
lines changed

src/textual/app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ def __init__(
768768
self._css_update_count: int = 0
769769
"""Incremented when CSS is invalidated."""
770770

771+
self.theme_variables: dict[str, str] = {}
772+
"""Variables generated from the current theme."""
773+
771774
if self.ENABLE_COMMAND_PALETTE:
772775
for _key, binding in self._bindings:
773776
if binding.action in {"command_palette", "app.command_palette"}:
@@ -1180,7 +1183,10 @@ def get_css_variables(self) -> dict[str, str]:
11801183
# Apply the additional variables from the theme
11811184
variables = {**variables, **(theme.variables)}
11821185
theme_variables = self.get_theme_variable_defaults()
1183-
return {**theme_variables, **variables}
1186+
1187+
combined_variables = {**theme_variables, **variables}
1188+
self.theme_variables = combined_variables
1189+
return combined_variables
11841190

11851191
def get_theme(self, theme_name: str) -> Theme | None:
11861192
"""Get a theme by name.

tests/snapshot_tests/__snapshots__/test_snapshots/test_app_search_opens_and_displays_search_list.svg

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)