<commit_before>django-libsass
==============

A django-compressor filter to compile Sass files using libsass.

Installation
~~~~~~~~~~~~

Starting from a Django project with `django-compressor <https://github.com/django-compressor/django-compressor/>`_ set up::

 pip install django-libsass

and add django_libsass.SassCompiler to your COMPRESS_PRECOMPILERS setting::

 COMPRESS_PRECOMPILERS = (
     ('text/x-scss', 'django_libsass.SassCompiler'),
 )

You can now use the content type text/x-scss on your stylesheets, and have them
compiled seamlessly into CSS::

 {% compress css %}
     <link rel="stylesheet" type="text/x-scss" href="{% static "myapp/css/main.scss" %}" />
 {% endcompress %}


Imports
~~~~~~~

Relative paths in @import lines are followed as you would expect::

 @import "../variables.scss";

Additionally, Django's STATICFILES_FINDERS setting is consulted, and all possible locations
for static files *on the local filesystem* are included on the search path. This makes it
possible to import files across different apps::

 @import "myotherapp/css/widget.scss"


Source comments
~~~~~~~~~~~~~~~~~~~

SASS source comments (adds comments about source lines) are enabled when Django's DEBUG is
enabled. This settings can be override with a LIBSASS_SOURCE_COMMENTS boolean setting.


Why django-libsass?
~~~~~~~~~~~~~~~~~~~

We wanted to use Sass in a Django project without introducing any external (non pip-installable)
dependencies. (Actually, we wanted to use Less, but the same arguments apply...) There are a few
pure Python implementations of Sass and Less, but we found that they invariably didn't match the
behaviour of the reference compilers, either in their handling of @imports or lesser-used CSS
features such as media queries.

`libsass <http://libsass.org/>`_ is a mature C/C++ port of the Sass engine, co-developed by the<commit_msg>grammar fix for source comments documentation<commit_after>django-libsass
==============

A django-compressor filter to compile Sass files using libsass.

Installation
~~~~~~~~~~~~

Starting from a Django project with `django-compressor <https://github.com/django-compressor/django-compressor/>`_ set up::

 pip install django-libsass

and add django_libsass.SassCompiler to your COMPRESS_PRECOMPILERS setting::

 COMPRESS_PRECOMPILERS = (
     ('text/x-scss', 'django_libsass.SassCompiler'),
 )

You can now use the content type text/x-scss on your stylesheets, and have them
compiled seamlessly into CSS::

 {% compress css %}
     <link rel="stylesheet" type="text/x-scss" href="{% static "myapp/css/main.scss" %}" />
 {% endcompress %}


Imports
~~~~~~~

Relative paths in @import lines are followed as you would expect::

 @import "../variables.scss";

Additionally, Django's STATICFILES_FINDERS setting is consulted, and all possible locations
for static files *on the local filesystem* are included on the search path. This makes it
possible to import files across different apps::

 @import "myotherapp/css/widget.scss"


Source comments
~~~~~~~~~~~~~~~

SASS source comments (adds comments about source lines) are enabled when Django's DEBUG is
enabled. This setting can be overridden with a LIBSASS_SOURCE_COMMENTS boolean setting.


Why django-libsass?
~~~~~~~~~~~~~~~~~~~

We wanted to use Sass in a Django project without introducing any external (non pip-installable)
dependencies. (Actually, we wanted to use Less, but the same arguments apply...) There are a few
pure Python implementations of Sass and Less, but we found that they invariably didn't match the
behaviour of the reference compilers, either in their handling of @imports or lesser-used CSS
features such as media queries.

`libsass <http://libsass.org/>`_ is a mature C/C++ port of the Sass engine, co-developed by the
{'fraction_non_alphanumeric': 0.11043270507034776, 'fraction_numerical': 0.0, 'mean_word_length': 4.850931677018633, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7404182', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1000, 'n_words': 442}