From f02f0785fa8ab88e601ad5573ca7bdc662d94e4e Mon Sep 17 00:00:00 2001 From: notiant <238434866+notiant@users.noreply.github.com> Date: Thu, 5 Mar 2026 12:21:36 +0100 Subject: [PATCH] Add {{mode}} tag to template renderer --- Scripts/python/src/theming/lib/renderer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Scripts/python/src/theming/lib/renderer.py b/Scripts/python/src/theming/lib/renderer.py index 7c2995f61..8e82295d5 100644 --- a/Scripts/python/src/theming/lib/renderer.py +++ b/Scripts/python/src/theming/lib/renderer.py @@ -509,6 +509,13 @@ class TemplateRenderer: base = parts[0].strip() filters = [p.strip() for p in parts[1:]] + # Handle {{mode}} tag - resolves to current theme mode + if base == "mode": + result_str = self.default_mode + for filter_str in filters: + result_str = self._apply_string_or_color_filter(result_str, filter_str, expr) + return result_str + # Try scope resolution first resolved = self._resolve_from_scope(base, scope) if resolved is not None: