Skip to content

Commit 714a2cf

Browse files
committed
Enable sass source comments
Enable when Django's DEBUG setting is enabled. Optionally override with it's own setting
1 parent 8260950 commit 714a2cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

django_libsass.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
from django.conf import settings
12
from django.contrib.staticfiles.finders import get_finders
23

34
import sass
45
from compressor.filters.base import FilterBase
56

7+
SOURCE_COMMENTS = getattr(settings, 'LIBSASS_SOURCE_COMMENTS', settings.DEBUG)
8+
9+
610
def get_include_paths():
711
"""
812
Generate a list of include paths that libsass should use to find files
@@ -48,6 +52,6 @@ def __init__(self, content, attrs=None, filter_type=None, charset=None, filename
4852

4953
def input(self, **kwargs):
5054
if self.filename:
51-
return compile(filename=self.filename)
55+
return compile(filename=self.filename, source_comments=SOURCE_COMMENTS)
5256
else:
5357
return compile(string=self.content)

0 commit comments

Comments
 (0)