From e0590c356b5adbcc9662fbe3ac509cb4af034b68 Mon Sep 17 00:00:00 2001 From: Nate Hardison Date: Sat, 1 Jun 2013 12:56:42 -0700 Subject: [PATCH] Rewrite the main course.scss file as well Just as is done with the main LMS application.scss file, rewrite the course.scss file with Mako to conditionally import a theme's variables overrides. Add the course.scss file to the list of ignored Git files so that it doesn't keep getting committed over and over again. This also requires us to add a hardcoded line in the assets Rakefile for the moment, so that the course.scss.mako file gets properly preprocessed. Once the preprocessing is done by a Django management command, we won't have to do this anymore. --- .gitignore | 1 + lms/static/sass/{course.scss => course.scss.mako} | 14 ++++++++++++++ 2 files changed, 15 insertions(+) rename lms/static/sass/{course.scss => course.scss.mako} (73%) diff --git a/.gitignore b/.gitignore index 05e76c4caa..83e2b67655 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ conf/locale/en/LC_MESSAGES/*.po !messages.po lms/static/sass/*.css lms/static/sass/application.scss +lms/static/sass/course.scss cms/static/sass/*.css lms/lib/comment_client/python nosetests.xml diff --git a/lms/static/sass/course.scss b/lms/static/sass/course.scss.mako similarity index 73% rename from lms/static/sass/course.scss rename to lms/static/sass/course.scss.mako index e57865fa9d..9d65505316 100644 --- a/lms/static/sass/course.scss +++ b/lms/static/sass/course.scss.mako @@ -4,6 +4,20 @@ @import 'base/font_face'; @import 'base/mixins'; @import 'base/variables'; + +## 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//, with its base Sass file in +## themes//static/sass/_.scss. That one entry +## point can be used to @import in as many other things as needed. +% if env.get('THEME_NAME') is not None: + // import theme's Sass overrides + @import '${env.get('THEME_NAME')}'; +% endif + @import 'base/base'; @import 'base/extends'; @import 'base/animations';