Summary
The Adapt framework (PR adaptlearning/adapt_framework#3578) adds support for reading themeVariables from config.json during grunt/LESS compilation, generating both LESS variables and CSS custom properties. Currently the AAT stores these in course.themeVariables, but the framework expects them in config.json.
Changes needed
writeCustomLess(): Read themeVariables from config data first, fall back to course data for unmigrated courses
processFileVariables(): Accept variables parameter instead of reading from course.data.themeVariables
applyHandler() / removeHandler(): Find config record by _courseId + _type: 'config' and update it instead of the course record
processCustomStyling(): Accept variables parameter directly
- Version-based LESS generation: Use
semver to check framework version; skip LESS variable generation when framework handles it natively
- Import migration: Register content migration to move
course.themeVariables → config.themeVariables on course import
- Add
semver dependency
Backward compatibility
- Build fallback:
configData[attributeKey] || courseData[attributeKey] || {} handles unmigrated courses
- Import migration handles old exports with themeVariables on course
Summary
The Adapt framework (PR adaptlearning/adapt_framework#3578) adds support for reading
themeVariablesfromconfig.jsonduring grunt/LESS compilation, generating both LESS variables and CSS custom properties. Currently the AAT stores these incourse.themeVariables, but the framework expects them inconfig.json.Changes needed
writeCustomLess(): ReadthemeVariablesfrom config data first, fall back to course data for unmigrated coursesprocessFileVariables(): Accept variables parameter instead of reading fromcourse.data.themeVariablesapplyHandler()/removeHandler(): Find config record by_courseId+_type: 'config'and update it instead of the course recordprocessCustomStyling(): Accept variables parameter directlysemverto check framework version; skip LESS variable generation when framework handles it nativelycourse.themeVariables→config.themeVariableson course importsemverdependencyBackward compatibility
configData[attributeKey] || courseData[attributeKey] || {}handles unmigrated courses