From cc1b9726ce97c5f7d2952f6aaab0c1ad3f7f5007 Mon Sep 17 00:00:00 2001 From: muhammadali286 Date: Tue, 25 Aug 2026 10:36:54 +0500 Subject: [PATCH] feat: per-site xBlock warning colour via XBLOCK_COLORS (EDLYPRODUCT-8495) Expose the xBlock warning colours as CSS custom properties so a tenant can override the ORA "In Progress" badge colour from site configuration instead of requiring a theme rebuild. Read from a dedicated `XBLOCK_COLORS` site_values key rather than `COLORS`, because the panel wholesale-replaces `COLORS` on every Appearance save and would silently drop these keys. Defaults match the theme's existing SASS values, so a site with no `XBLOCK_COLORS` renders exactly as before. --- openedx/features/edly/context_processor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openedx/features/edly/context_processor.py b/openedx/features/edly/context_processor.py index 0b56881f9179..3c449c8df590 100644 --- a/openedx/features/edly/context_processor.py +++ b/openedx/features/edly/context_processor.py @@ -19,6 +19,10 @@ 'logo': "https://edly-edx-theme-files.s3.amazonaws.com/st-lutherx-logo.png", 'favicon': "https://edly-edx-theme-files.s3.amazonaws.com/favicon.ico", } +DEFAULT_XBLOCK_COLOR_DICT = { + 'xblock-color-warning': '#F59810', + 'xblock-color-warning-light': '#FFFAF1', +} def dynamic_theming_context(request): # pylint: disable=unused-argument @@ -117,6 +121,12 @@ def get_theme_colors(): 'secondary-darken-10p': get_darken_color(secondary_darken_10p, secondary, 0.1), } + # Kept in its own `XBLOCK_COLORS` site_values key rather than inside `COLORS`: + # the panel wholesale-replaces `COLORS` on every Appearance save, which would + # silently drop these. Defaults match the theme's SASS values, so a site with no + # `XBLOCK_COLORS` renders exactly as before. + colours.update(configuration_helpers.get_dict('XBLOCK_COLORS', DEFAULT_XBLOCK_COLOR_DICT)) + return colours