Commit 85453f70 by David Baumgold

Fix theme issues in Sass preprocessing

parent df1b7f44
...@@ -53,7 +53,10 @@ class Command(NoArgsCommand): ...@@ -53,7 +53,10 @@ class Command(NoArgsCommand):
""" """
# TODO: do we need to include anything else? # TODO: do we need to include anything else?
# TODO: do this with the django-settings-context-processor # TODO: do this with the django-settings-context-processor
return { "THEME_NAME" : getattr(settings, "THEME_NAME", None) } return {
"FEATURES": settings.FEATURES,
"THEME_NAME" : getattr(settings, "THEME_NAME", None),
}
def __preprocess(self, infile, outfile): def __preprocess(self, infile, outfile):
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
## called themes/<theme-name>/, with its base Sass file in ## called themes/<theme-name>/, with its base Sass file in
## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry
## point can be used to @import in as many other things as needed. ## point can be used to @import in as many other things as needed.
% if env.get('THEME_NAME') is not None: % if env["FEATURES"].get("USE_CUSTOM_THEME", False):
// import theme's Sass overrides // import theme's Sass overrides
@import '${env.get('THEME_NAME')}'; @import '${env.get('THEME_NAME')}';
% endif % endif
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
## called themes/<theme-name>/, with its base Sass file in ## called themes/<theme-name>/, with its base Sass file in
## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry
## point can be used to @import in as many other things as needed. ## point can be used to @import in as many other things as needed.
% if env.get('THEME_NAME') is not None: % if env["FEATURES"].get("USE_CUSTOM_THEME", False):
// import theme's Sass overrides // import theme's Sass overrides
@import '${env.get('THEME_NAME')}'; @import '${env.get('THEME_NAME')}';
% endif % endif
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
## called themes/<theme-name>/, with its base Sass file in ## called themes/<theme-name>/, with its base Sass file in
## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry
## point can be used to @import in as many other things as needed. ## point can be used to @import in as many other things as needed.
% if env.get('THEME_NAME') is not None: % if env["FEATURES"].get("USE_CUSTOM_THEME", False):
// import theme's Sass overrides // import theme's Sass overrides
@import '${env.get('THEME_NAME')}'; @import '${env.get('THEME_NAME')}';
% endif % endif
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
## called themes/<theme-name>/, with its base Sass file in ## called themes/<theme-name>/, with its base Sass file in
## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry
## point can be used to @import in as many other things as needed. ## point can be used to @import in as many other things as needed.
% if env.get('THEME_NAME') is not None: % if env["FEATURES"].get("USE_CUSTOM_THEME", False):
// import theme's Sass overrides // import theme's Sass overrides
@import '${env.get('THEME_NAME')}'; @import '${env.get('THEME_NAME')}';
% endif % endif
......
# Theming constants # Theming constants
THEME_NAME = ENV_TOKENS['THEME_NAME'] USE_CUSTOM_THEME = ENV_TOKENS['USE_CUSTOM_THEME']
USE_CUSTOM_THEME = !(THEME_NAME.nil? || THEME_NAME.empty?)
if USE_CUSTOM_THEME if USE_CUSTOM_THEME
THEME_NAME = ENV_TOKENS['THEME_NAME']
THEME_ROOT = File.join(ENV_ROOT, "themes", THEME_NAME) THEME_ROOT = File.join(ENV_ROOT, "themes", THEME_NAME)
THEME_SASS = File.join(THEME_ROOT, "static", "sass") THEME_SASS = File.join(THEME_ROOT, "static", "sass")
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment