Merge "Pass the value of STATIC_URL to the scss variable."
This commit is contained in:
commit
4fce531860
@ -13,11 +13,16 @@
|
||||
import os.path
|
||||
|
||||
from compressor.filters.base import FilterBase
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.finders import get_finders
|
||||
|
||||
import sass
|
||||
|
||||
|
||||
def static_url():
|
||||
return settings.STATIC_URL
|
||||
|
||||
|
||||
def importer(path, prev):
|
||||
if path.startswith('/'):
|
||||
# An absolute path was used, don't try relative paths.
|
||||
@ -62,6 +67,7 @@ class ScssFilter(FilterBase):
|
||||
args = {
|
||||
'importers': [(0, importer)],
|
||||
'output_style': 'compressed',
|
||||
'custom_functions': {static_url},
|
||||
}
|
||||
if self.filename:
|
||||
args['filename'] = self.filename
|
||||
|
@ -3,9 +3,8 @@
|
||||
|
||||
|
||||
/* When used with Horizon via Django, this value is set automatically from
|
||||
settings.py and is added dynamically to the namespace through
|
||||
horizon/utils/scss_filter.py */
|
||||
$static_url: "/static/" !default;
|
||||
settings.py. */
|
||||
$static_url: static_url() !default;
|
||||
|
||||
|
||||
/* Horizon Custom Variables */
|
||||
|
Loading…
x
Reference in New Issue
Block a user