Repository navigation
feat: develop brand-openedx locally with "tutor dev" + fix legacy MFE theme CSS URLs - #252
Conversation
raw.githubusercontent.com serves files as text/plain with "X-Content-Type-Options: nosniff", so browsers refuse to apply them as stylesheets and the legacy MFEs silently fall back to the default Paragon theme. Use jsDelivr, which serves text/css, like the frontend-base theme URLs already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Add the INDIGO_BRAND_OPENEDX_PATH setting. When it is set, "tutor dev" runs an "indigo-brand" service that builds the local brand-openedx checkout, rebuilds it on change and serves its CSS on INDIGO_BRAND_OPENEDX_DEV_PORT (3000 by default). In development, the MFEs then load the theme CSS from there instead of jsDelivr. Production is not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Fix the E501 errors reported by "make test-lint". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Faraz32123
left a comment
There was a problem hiding this comment.
Tested locally with tutor dev against a brand-openedx checkout: SCSS edits (learning + learner dashboard) and design token changes both rebuild and show up in the MFEs. LGTM 👍
One small thing: the SCSS watcher only watches paragon/, but paragon/_dark.scss imports ../themes/dark/_utilities.scss and ../themes/dark/_extras.scss, so edits to the dark theme files don't trigger a rebuild. Adding --watch themes to the first nodemon call should fix it:
npx nodemon --legacy-watch --on-change-only --watch paragon --watch themes \\
--ignore 'paragon/build/**' --ignore 'paragon/tokens/**' \\
--ext scss,css --exec "$$CORE_BUILD" &
paragon/_dark.scss imports themes/dark/_utilities.scss and themes/dark/_extras.scss, so also watch the themes/ folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Good catch, thanks! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Resolve the conflicts with #252 by keeping this branch's version: no @edx/brand npm install, and the theme CSS URLs built from BRAND_CSS_BASE_URL with brandOverride only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
indigo-3.1.1 fixes the position of the account menu in the mobile header. Also drop the changelog entry about the raw.githubusercontent.com URLs: that fix was already shipped by #252, which has its own entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac
Description
This PR makes it possible to work on a local brand-openedx checkout and see style changes live in
tutor dev, and fixes the theme CSS URLs used by the legacy MFEs.1. Local brand-openedx development (
feat)Until now, the MFEs always loaded the theme CSS from the published brand-openedx repository, so style changes could only be tested after pushing them.
This adds a new
INDIGO_BRAND_OPENEDX_PATHsetting. When it is set, in development mode:indigo-brandservice builds the local brand-openedx checkout and serves its CSS athttp://localhost:3000.paragon/*.scss→ rebuildscore.cssonly (~10 s)paragon/tokens/**→ rebuilds all CSS (~2 min)dist/is not deleted during rebuilds, so the previous CSS keeps being served.core.css,light.cssanddark.cssfrom the local service. This overrides the theme URLs set by other plugins, such as tutor-contrib-paragon.If the path doesn't point to a brand-openedx checkout,
tutor config savefails with a clear error message.Production (
tutor local,tutor k8s) is not affected: the settings are only rendered in the development LMS settings and the dev docker-compose file. When the setting is unset (the default), the rendered environment is unchanged.New settings:
INDIGO_BRAND_OPENEDX_PATH""INDIGO_BRAND_OPENEDX_DEV_PORT3000INDIGO_BRAND_OPENEDX_DEV_DOCKER_IMAGEdocker.io/node:222. Fix: legacy MFE theme CSS loaded from raw.githubusercontent.com (
fix)PARAGON_THEME_URLS, used by the legacy MFEs, pointed toraw.githubusercontent.com. That host serves files astext/plainwithX-Content-Type-Options: nosniff, so browsers refuse to apply them as stylesheets. The legacy MFEs then silently fall back to the default Paragon theme. These URLs now use jsDelivr, which servestext/css, like the frontend-base theme URLs already do. Same repository, branch and files.This is a separate commit, so it can be cherry-picked onto other branches.
Testing instructions
Local brand development
tutor dev logs -f indigo-brandand wait for the server to start. Then open http://localhost:3000/light.css; it should show CSS.core.css,light.cssanddark.cssshould load fromlocalhost:3000.paragon/_overrides.scss(for examplebody { outline: 5px solid red; }). After the rebuild, a hard refresh should show the change.color.primary.baseinparagon/tokens/src/themes/light/color.json. After the full rebuild (~2 min), a hard refresh should show the new primary color.tutor config save --unset INDIGO_BRAND_OPENEDX_PATH && tutor dev launch. The CSS should load from jsDelivr again, and theindigo-brandservice should not be running.tutor config save --set INDIGO_BRAND_OPENEDX_PATH=/nope. It should fail with a clear error message.production.pyshould not contain anylocalhost:3000URL.Legacy MFE theme URLs
INDIGO_BRAND_OPENEDX_PATH, open a legacy MFE (e.g. learning).light.min.cssanddark.min.cssshould load fromcdn.jsdelivr.netastext/css.Notes
https://purge.jsdelivr.net/gh/<owner>/<repo>@<branch>/dist/<file>.min.css.dist/andparagon/build/folders of the local brand-openedx checkout.🤖 Generated with Claude Code
https://claude.ai/code/session_01GnPNrsTx73ShPB6Kc6FWac