laws-africa / django-sass-processor-dart-sass

Shim to make django-sass-processor use Dart SASS since libsass is deprecated.

Home Page:https://pypi.org/project/django-sass-processor-dart-sass/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-sass-processor-dart-sass

This is a shim that makes django-sass-processor use Dart Sass rather than libsass because libsass is deprecated.

This provides a replacement for sass.py provided by libsass and simply calls out to sass provided by Dart Sass. Dart Sass must be installed separately.

Note: vanilla Dart Sass only

This does not support the custom functions provided by django-sass-processor through libsass. It only supports vanilla Dart Sass.

How to use it

This clashes with libsass, so remove libsass if you have it installed:

pip uninstall libsass

Install Dart Sass by following their instructions.

Install this package:

pip install django-sass-processor-dart-sass

That's it. Install and use django-sass-processor as normal.

Advanced usage

If you need to change the sass command, override it like so:

from sass import dart_sass
dart_sass.sass_command = ['/special/sass']

# to use npm sass, use:
dart_sass.sass_command = ['npx', 'sass']

Build and release

Build: python3 -m build

Release to Pypi: python3 -m twine upload dist/*

About

Shim to make django-sass-processor use Dart SASS since libsass is deprecated.

https://pypi.org/project/django-sass-processor-dart-sass/

License:MIT License


Languages

Language:Python 100.0%