feat: per-site xBlock warning colour via XBLOCK_COLORS (EDLYPRODUCT-8495) - #761
Open
muhammadali286 wants to merge 1 commit into
Open
feat: per-site xBlock warning colour via XBLOCK_COLORS (EDLYPRODUCT-8495)#761muhammadali286 wants to merge 1 commit into
muhammadali286 wants to merge 1 commit into
Conversation
…495) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Exposes the xBlock warning colours as CSS custom properties so a tenant can override the ORA "In Progress" badge colour from site configuration, with no theme rebuild.
Pairs with edly-io/edly-edx-themes#446 — both must be deployed for the badge to become configurable. Safe to merge in either order (see Backwards compatibility).
Why
Oryx reported the orange "In Progress" badge is off-brand and asked for their teal (EDLYPRODUCT-8495).
The colour was
$xblock-color-warning: #F59810— a compile-time SASS scalar in the theme, shared by every tenant ongestalt. There was no way to change it for one tenant without either recolouring it for all of them or forking the theme.The panel Appearance UI only ever sends
primary_color/secondary_color, and for Oryx both are already spoken for (primary#007A8Ateal, secondary#76777Agrey), so neither could carry the badge colour.How
get_theme_colors()now merges anXBLOCK_COLORSdict into the emitted custom properties.Why a dedicated
XBLOCK_COLORSkey rather than adding toCOLORS: the panel does a wholesale replace ofCOLORSon every Appearance save —site_configurations[field] = request_data[field]inedly_panel_app/api/v1/views.py(onlyDJANGO_SETTINGS_OVERRIDEis merged). A key stored insideCOLORSwould be silently wiped the next time anyone touched Appearance. The panel never sendsXBLOCK_COLORS, so it survives.No template change needed —
<theme>/lms/templates/main.htmlalready loops every key ofedly_colors_configinto:root.Backwards compatibility
DEFAULT_XBLOCK_COLOR_DICTholds the theme's existing values (#F59810/#FFFAF1), andconfiguration_helpers.get_dictmerges defaults under the site value. A site with noXBLOCK_COLORSemits exactly the same colours as today. The paired theme change also keeps the old SASS value as the CSSvar()fallback, so this is safe to merge and deploy independently of the theme PR.Configuring a tenant
Set on the tenant's LMS, preview and CMS sites. Partial config is fine — unset keys fall back to the defaults.
Testing
See the test steps posted on EDLYPRODUCT-8495.
Key regression check: on a site with no
XBLOCK_COLORS,.step__status__valuemust still compute to#F59810.