andreyfedoseev / django-static-precompiler

Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.
Other
222 stars 60 forks source link

Error thrown when using Dart Sass #136

Closed rwhitney001 closed 1 year ago

rwhitney001 commented 3 years ago

I've noticed that whenever I try to compile scss files with django-static-precompiler using Dart Sass that a StaticCompliationError is thrown with no exception message thrown. It works fine with ruby-sass but ruby sass is deprecated. Is it possible that dart sass will ever be supported?

bast0006 commented 3 years ago

This is because (at minimum) dart-sass utilizes the -s flag for output style, whereas ruby-sass uses -t. It also doesn't support varying precision of calculations the same way ruby-sass does. You can subclass the SASS/SCSS compilers to adjust them and apply them in your settings.py file to use at the moment.

I believe the "no error" is because calling dart-sass with the wrong flags prints help to stdout, not stderr, which is captured here.

vgoof commented 3 years ago

I noticed the same issue. You could uncomment line 74 in static_precompiler/compiler/scss.py and do not give settings (of course you do not get the correct functionality and this is a very nasty solution).

By the way, I am using dart-sass because ruby-sass is apperently end-of-life. Is there anyother compiler someone could recommend?

adorum commented 3 years ago

Any news on this? Is the Dart Sass planned to be supported?

vgoof commented 3 years ago

You can use the libsass library instead, you can use pip to install it, much more easy to set up.

andreyfedoseev commented 1 year ago

I'm closing this as a duplicate of #148 even though this is one was submitted earlier.