Skip to content

Commit bd3f65f

Browse files
Add support for Dart Sass
1 parent bceff1b commit bd3f65f

File tree

11 files changed

+433
-73
lines changed

11 files changed

+433
-73
lines changed

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22

33
### Dev
44

5+
#### Deprecation
6+
7+
- Ruby-based Sass compiler is deprecated and will be removed in 3.0
8+
9+
#### New
10+
11+
- Added support for Dart Sass, see documentation on how to enable it.
12+
Dart Sass will become the default Sass compiler starting from 3.0
13+
14+
#### Bugfixes
15+
516
- Fix the bug with a greedy regex in the URL converter
17+
18+
#### Misc
19+
620
- Ensure compatibility with the latest versions of compilers:
721
- [email protected] (may break compatibility with older versions)
822

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM andreyfedoseev/django-static-precompiler:18.04-1
1+
FROM andreyfedoseev/django-static-precompiler:18.04-2
22
ARG DEBIAN_FRONTEND=noninteractive
33
ENV TZ=Etc/UTC
44
RUN apt update && \

Dockerfile-base

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:18.04
22
MAINTAINER Andrey Fedoseev <[email protected]>
3-
RUN apt-get update && apt-get install -y autoconf libtool ruby-dev npm
3+
RUN apt-get update && apt-get install -y autoconf libtool ruby-dev npm wget
44
RUN ln -s /usr/bin/nodejs /usr/local/bin/node
55
RUN npm install -g [email protected]
66
RUN npm install -g [email protected]
@@ -10,3 +10,6 @@ RUN npm install -g [email protected]
1010
RUN npm install -g [email protected]
1111
RUN gem install sass -v 3.4.22
1212
RUN gem install compass -v 1.0.1
13+
RUN wget -O /tmp/dart-sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.56.1/dart-sass-1.56.1-linux-x64.tar.gz && \
14+
tar -xzf /tmp/dart-sass.tar.gz -C /opt && \
15+
rm -rf /tmp/dart-sass.tar.gz

docs/compiler-settings.rst

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ Example:
119119
SASS / SCSS
120120
===========
121121

122+
Ruby-based (legacy) SASS compiler.
123+
122124
``executable``
123125
Path to SASS compiler executable. Default: "sass".
124126

@@ -159,6 +161,48 @@ Example:
159161
)
160162
161163
164+
Dart Sass
165+
=========
166+
167+
Dart Sass is the current implementation of SASS.
168+
169+
.. note:: Dart Sass compiler is not enabled by default. See the example below for how to enable it.
170+
171+
Options:
172+
173+
``sourcemap_enabled``
174+
Boolean. Set to ``True`` to enable source maps. Default: ``False``.
175+
176+
``load_paths``
177+
List of additional paths to find imports. Default: ``None``.
178+
179+
``output_style``
180+
Output style. Default: ``None``.
181+
Can be "expanded" or "compressed".
182+
183+
Example:
184+
185+
.. code-block:: python
186+
187+
STATIC_PRECOMPILER_COMPILERS = (
188+
(
189+
"static_precompiler.compilers.dart_sass.SCSS",
190+
{
191+
"sourcemap_enabled": True,
192+
"load_paths": ["/path"],
193+
},
194+
),
195+
(
196+
"static_precompiler.compilers.dart_sass.SASS",
197+
{
198+
"sourcemap_enabled": True,
199+
"load_paths": ["/path"],
200+
"output_style": "compressed",
201+
},
202+
),
203+
)
204+
205+
162206
Libsass
163207
=======
164208

@@ -212,8 +256,6 @@ Example:
212256
),
213257
)
214258
215-
.. note:: Libsass compiler doesn't support Compass extension, but you can replace it with `compass-mixins <https://github.com/Igosuki/compass-mixins>`_.
216-
217259
218260
LESS
219261
====

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
# General information about the project.
4545
project = "django-static-precompiler"
46-
copyright = "2021, Andrey Fedoseev"
46+
copyright = "2022, Andrey Fedoseev"
4747
author = "Andrey Fedoseev"
4848

4949
# The version info for the project you're documenting, acts as replacement for
@@ -60,7 +60,7 @@
6060
#
6161
# This is also used if you do content translation via gettext catalogs.
6262
# Usually you set "language" from the command line for these cases.
63-
language = None
63+
language = "en"
6464

6565
# There are two options for replacing |today|: either, you set today to some
6666
# non-false value, then it is used:

0 commit comments

Comments
 (0)