<commit_before># django-compressor-toolkit

[![Build Status](https://travis-ci.org/kottenator/django-compressor-toolkit.svg?branch=master)](https://travis-ci.org/kottenator/django-compressor-toolkit)

Set of add-ons for [django-compressor](https://github.com/django-compressor/django-compressor/)
that simply enables SCSS and ES6 in your Django project.

## Installation

```sh
pip install django-compressor-toolkit
```

```py
// settings.py

INSTALLED_APPS += ('compressor_toolkit',)
```

## Add-ons

### SCSS pre-compiler

[SCSS](http://sass-lang.com/) is a great language that saves your time and brings joy to CSS development.

The add-on does next:
SCSS → (
[node-sass](https://github.com/sass/node-sass) +
[Autoprefixer](https://github.com/postcss/autoprefixer)
) → CSS.

It also enables Django static imports in SCSS, see the example below.

#### Usage

```py
// settings.py

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'compressor_toolkit.precompilers.SCSSCompiler'),
)
```

```html
{# Django template #}

{% load compress %}

{% compress css %}
  <link type="text/x-scss" href="{% static 'app/layout.scss' %}">
{% endcompress %}
```

```scss
/* app/static/app/layout.scss */

@import "base/variables";

.title {
  font: bold $title-size Arial, sans-serif;
}
```

```scss
/* base/static/base/variables.scss */

$title-size: 30px;
```

#### Requisites

You need `node-sass`, `postcss-cli` and `autoprefixer` to be installed. Quick install:

```sh
npm install node-sass postcss-cli autoprefixer<commit_msg>Add `rel="stylesheet"` to example in README<commit_after># django-compressor-toolkit

[![Build Status](https://travis-ci.org/kottenator/django-compressor-toolkit.svg?branch=master)](https://travis-ci.org/kottenator/django-compressor-toolkit)

Set of add-ons for [django-compressor](https://github.com/django-compressor/django-compressor/)
that simply enables SCSS and ES6 in your Django project.

## Installation

```sh
pip install django-compressor-toolkit
```

```py
// settings.py

INSTALLED_APPS += ('compressor_toolkit',)
```

## Add-ons

### SCSS pre-compiler

[SCSS](http://sass-lang.com/) is a great language that saves your time and brings joy to CSS development.

The add-on does next:
SCSS → (
[node-sass](https://github.com/sass/node-sass) +
[Autoprefixer](https://github.com/postcss/autoprefixer)
) → CSS.

It also enables Django static imports in SCSS, see the example below.

#### Usage

```py
// settings.py

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'compressor_toolkit.precompilers.SCSSCompiler'),
)
```

```html
{# Django template #}

{% load compress %}

{% compress css %}
  <link rel="stylesheet" type="text/x-scss" href="{% static 'app/layout.scss' %}">
{% endcompress %}
```

```scss
/* app/static/app/layout.scss */

@import "base/variables";

.title {
  font: bold $title-size Arial, sans-serif;
}
```

```scss
/* base/static/base/variables.scss */

$title-size: 30px;
```

#### Requisites

You need `node-sass`, `postcss-cli` and `autoprefixer` to be installed. Quick install:

```sh
npm install node-sass postcss-cli autoprefixer
{'fraction_non_alphanumeric': 0.1730081300813008, 'fraction_numerical': 0.001951219512195122, 'mean_word_length': 4.483065953654189, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, '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': '2664759', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1092, 'n_words': 243}