This commit adds the requisite settings and startup features to enable integration of themes into the edX platform. It does not yet provide hooks in any of the templates, but it does cause the main `lms/static/sass/application.scss` file to `@import` a theme's base Sass. Template hooks will come down the road. CHANGELOG --------- Define a new `MITX_FEATURE`, `USE_CUSTOM_THEME`, that when enabled, can be used in templates to determine whether or not custom theme templates should be used instead of the defaults. Also define a new setting, `THEME_NAME`, which will be used to locate theme-specific files. Establish the convention that themes will be stored outside of the `REPO_ROOT`, inside the `ENV_ROOT`, in a directory named `themes/`. `themes/<THEME_NAME>` will store the files for a particular theme. Provide a function, `enable_theme`, that modifies the template and static asset load paths appropriately to include the theme's files. Move the main LMS Sass file to a Mako template that conditionally `@import`s the theme's base Sass file when a theme is enabled. Add logic to the assets Rakefile to properly preprocess any Sass/ Mako templates before compiling them.
52 lines
1.4 KiB
Mako
52 lines
1.4 KiB
Mako
@import 'bourbon/bourbon';
|
|
|
|
@import 'base/reset';
|
|
@import 'base/font_face';
|
|
@import 'base/mixins';
|
|
@import 'base/variables';
|
|
@import 'base/base';
|
|
@import 'base/extends';
|
|
@import 'base/animations';
|
|
|
|
// Multicourse styles
|
|
@import 'shared/forms';
|
|
@import 'shared/footer';
|
|
@import 'shared/header';
|
|
@import 'shared/course_object';
|
|
@import 'shared/course_filter';
|
|
@import 'shared/modal';
|
|
@import 'shared/activation_messages';
|
|
|
|
@import 'multicourse/home';
|
|
@import 'multicourse/dashboard';
|
|
@import 'multicourse/account';
|
|
@import 'multicourse/testcenter-register';
|
|
@import 'multicourse/courses';
|
|
@import 'multicourse/course_about';
|
|
@import 'multicourse/jobs';
|
|
@import 'multicourse/media-kit';
|
|
@import 'multicourse/about_pages';
|
|
@import 'multicourse/press_release';
|
|
@import 'multicourse/password_reset';
|
|
@import 'multicourse/error-pages';
|
|
@import 'multicourse/help';
|
|
@import 'multicourse/edge';
|
|
|
|
@import 'discussion';
|
|
@import 'news';
|
|
|
|
@import 'shame';
|
|
|
|
## THEMING
|
|
## -------
|
|
## Set up this file to import an edX theme library if the environment
|
|
## indicates that a theme should be used. The assumption is that the
|
|
## theme resides outside of this main edX repository, in a directory
|
|
## called themes/<theme-name>/, with its base Sass file in
|
|
## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry
|
|
## point can be used to @import in as many other things as needed.
|
|
% if not env['THEME_NAME'] is None:
|
|
// import theme's Sass overrides
|
|
@import '${env['THEME_NAME']}'
|
|
% endif
|